From cem at fizy.com Sat Feb 11 21:45:59 2012 From: cem at fizy.com (cem yildiz) Date: Sat, 11 Feb 2012 22:45:59 +0200 Subject: [DB-SIG] dbabi - ms sql 2005 Message-ID: hi, i am trying to connect sql server 2005 via db api 2.0 in last 3 days but i couldn't handle it. i can connect to the database remotely by navicat without any problem. i would be really very happy if anyone knows where do i make the mistake. >>> import adodbapi >>> cs = "Provider=SQLOLEDB;Data Source=sql2002.shared-servers.com,1086;Initial Catalog=ableton;User ID=ableton;Password=miklagard1;" >>> conn = adodbapi.connect(cs) Traceback (most recent call last): File "", line 1, in File "adodbapi.py", line 298, in connect raise InterfaceError #Probably COM Error adodbapi.InterfaceError thank you all, cem -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Mon Feb 13 17:18:15 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 13 Feb 2012 09:18:15 -0700 Subject: [DB-SIG] dbabi - ms sql 2005 In-Reply-To: References: Message-ID: Using Python 3.2.2 and pywin32-217 on Windows 7 (all 64 bit), I get this result (filtering out the crud): pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE Provider for SQL Server', "Login failed for user 'ableton'.", None, 0, -21472843), None) Which would mean that the server is working and does not recognize your password, which, I hope, is to be expected. I see nothing wrong with your code. What versions of everything are you using? -- Vernon On Sat, Feb 11, 2012 at 1:45 PM, cem yildiz wrote > hi, > > i am trying to connect sql server 2005 via db api 2.0 in last 3 days but i > couldn't handle it. i can connect to the database remotely by navicat > without any problem. i would be really very happy if anyone knows where do > i make the mistake. > > >>> import adodbapi > >>> cs = "Provider=SQLOLEDB;Data Source=sql2002.shared-servers.com,1086;Initial > Catalog=ableton;User ID=ableton;Password=miklagard1;" > >>> conn = adodbapi.connect(cs) > Traceback (most recent call last): > File "", line 1, in > File "adodbapi.py", line 298, in connect > raise InterfaceError #Probably COM Error > adodbapi.InterfaceError > > thank you all, > cem > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Mon Feb 13 17:33:00 2012 From: ethan at stoneleaf.us (Ethan Furman) Date: Mon, 13 Feb 2012 08:33:00 -0800 Subject: [DB-SIG] ANN: dbf.py 0.90.001 Message-ID: <4F393B3C.8070808@stoneleaf.us> Still messing with .dbf files? Somebody brought you a 15 year old floppy, which still luckily (?) worked, and now wants that ancient data? dbf to the rescue! Supported tables/features ========================= - dBase III - FoxPro - Visual FoxPro supported - Null value Supported field types ===================== - Char - Date - Logical - Memo - Numeric - Currency (returns Decimal) - DateTime - Double - Float (same as Numeric) - General - Integer - Picture Still to come (or, Not Yet Working ;) ===================================== - Index files (although you can create temporary memory indices) - auto incrementing fields Latest version can be found on PyPI at http://pypi.python.org/pypi/dbf. Comments, bug reports, etc, appreciated! ~Ethan~ From vernondcole at gmail.com Mon Feb 13 23:19:22 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 13 Feb 2012 15:19:22 -0700 Subject: [DB-SIG] How can I detect 64 bit versions of Python? Message-ID: This is a reworded re-post of a question which I just placed to the IronPython list. I repeat it here, because I hope to get a general answer which will work on CPython, too, since the database driver I support works on both implementations. [Note: this applies to Windows only, *nix users can stop reading now. (Lucky dogs.)] I am testing adodbapi using my new laptop which I have set up as an everything in 64-bit test bed. My default test database is an .mdb (so-called ACCESS database) file. Microsoft has decided that the JET engine, which has historically been used to read and write that format is to be deprecated, so there is no 64 bit version of it. It is replaced by the Access Database Engine 2010 redistributable.Of course, the new software requires a different connection string, one containing "Provider=Microsoft.ACE.OLEDB.12.0;". So, how can I tell which "width" of Python I am running, so I know which connection string to use? -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniele.varrazzo at gmail.com Mon Feb 13 23:54:12 2012 From: daniele.varrazzo at gmail.com (Daniele Varrazzo) Date: Mon, 13 Feb 2012 22:54:12 +0000 Subject: [DB-SIG] How can I detect 64 bit versions of Python? In-Reply-To: References: Message-ID: On Mon, Feb 13, 2012 at 10:19 PM, Vernon Cole wrote: > So, how can I tell which "width" of Python I am running, so I know which > connection string to use? I use sys.maxint, which is 2^63-1 on 64 bit and 2^31-1 on 32 bit. It's not available on py3, but sys.maxsize is available on both, and it's probably equivalent. -- Daniele From mal at egenix.com Tue Feb 14 00:02:36 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 14 Feb 2012 00:02:36 +0100 Subject: [DB-SIG] How can I detect 64 bit versions of Python? In-Reply-To: References: Message-ID: <4F39968C.4080100@egenix.com> Vernon Cole wrote: > This is a reworded re-post of a question which I just placed to the > IronPython list. I repeat it here, because I hope to get a general answer > which will work on CPython, too, since the database driver I support works > on both implementations. [Note: this applies to Windows only, *nix users > can stop reading now. (Lucky dogs.)] > > I am testing adodbapi using my new laptop which I have set up as an > everything in 64-bit test bed. > > My default test database is an .mdb (so-called ACCESS database) file. > Microsoft has decided that the JET engine, which has historically been used > to read and write that format is to be deprecated, so there is no 64 bit > version of it. It is replaced by the Access Database Engine 2010 > redistributable.Of > course, the new software requires a different connection string, one > containing "Provider=Microsoft.ACE.OLEDB.12.0;". > > So, how can I tell which "width" of Python I am running, so I know which > connection string to use? The safest bet is to have a look at sys.maxsize. If it's > 2**31, you have a 64-bit Python version, otherwise a 32-bit one. sys.maxsize is only available in Python 2.6 and later. If you support older versions, using the struct module can help: check the size of a pointer to find out which bit size the Python interpreter is using. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 13 2012) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From mal at egenix.com Tue Feb 14 00:11:41 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 14 Feb 2012 00:11:41 +0100 Subject: [DB-SIG] How can I detect 64 bit versions of Python? In-Reply-To: References: Message-ID: <4F3998AD.5060803@egenix.com> Daniele Varrazzo wrote: > On Mon, Feb 13, 2012 at 10:19 PM, Vernon Cole wrote: > >> So, how can I tell which "width" of Python I am running, so I know which >> connection string to use? > > I use sys.maxint, which is 2^63-1 on 64 bit and 2^31-1 on 32 bit. It's > not available on py3, but sys.maxsize is available on both, and it's > probably equivalent. Better use sys.maxsize :-) sys.maxint is 2**31-1 on Windows x64, since MS chose not to change the size of longs on Win64. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 14 2012) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/