Re: [python-win32] odbc under windows 7?
i am graham bloice and i am not the same person how is this possible ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7?
On 24/01/2011 18:46, Tim Roberts wrote: Gary L Smith wrote: I need to access data in an MS Access 2003 database using Python 2.5 or 2.6 running in Windows7. Windows7 doesn’t seem to have appropriate drivers for ODBC. My error messages consistently contain the phrase, “Data source name not found and no default driver specified.” While I see that others have run into the same problem, my web searches have only deepened my confusion – questions are routinely answered with suggestions that turn out to not work in Windows7. Suggestions such as SQL Alchemy or pyODBC don’t solve the problem, because it still boils down to the missing drivers. This is a volunteer effort, so even the Egenix product, mxODBC, at $69 is a little much. Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it’s just not possible, put me out of my misery. Do you have Access installed on this machine? That's always been one of the downsides of Access -- you have to have the Access run-time installed to use an Access database. Note that ODBC does not really have anything to do with Access. ODBC is just a generic database layer. If you don't have the Access runtime, then even mxODBC won't get you into the data. From the message, it sounds like you are getting into ODBC just fine, but there is no ODBC Access driver installed. Have you tried ADODB and direct DAO access? Both of them can be used with Access, although again without the runtime, I think you're in trouble. Originally set to Tim instead of the list, sorry for that. I'm not so sure about this. The Jet drivers (32 bit only) which can be used from ODBC have been supplied with every MS OS (even 64 bit ones). I've used this driver and ODBC to access .mdb files without Office or Access ever having been near machines. To see the drivers on your machine run up odbcad32.exe and check the drivers tab. To see 32 bit drivers on a 64 bit machine run Windows\SysWOW64\odbcad32.exe There is no 64 bit Jet driver, but from Office 2007 on, MS produced the ACE drivers (which are also available as a separate redistributable) which do appear in a 64 bit guise. Unfortunately I haven't been impressed with the drivers stability when multithreading. -- Regards, Graham Bloice ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7?
Gary: I was able to track down a Windows 7 - 64 bit computer this morning. Installed Python 3.1 (32 bit) Installed pywin32-214 for py31 (32 bit) Installed adodbapi 2.4 (to get the test.mdb database) I was able to read the data correctly. No Microsoft office components were installed. (I also found an error in my db_read.py sample program when run from Python 3, so this was a good test.) -- Vernon ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7?
On 1:59 PM, Gary L Smith wrote: Dear Pythoners, I need to access data in an MS Access 2003 database using Python 2.5 or 2.6 running in Windows7. Windows7 doesn't seem to have appropriate drivers for ODBC. My error messages consistently contain the phrase, Data source name not found and no default driver specified. While I see that others have run into the same problem, my web searches have only deepened my confusion -- questions are routinely answered with suggestions that turn out to not work in Windows7. Suggestions such as SQL Alchemy or pyODBC don't solve the problem, because it still boils down to the missing drivers. This is a volunteer effort, so even the Egenix product, mxODBC, at $69 is a little much. Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it's just not possible, put me out of my misery. Cheers, Gary Smith I've used SqlAlchemy to get data out of MS Access, but you have to use one of the old 0.5 versions. I only did that on Windows XP though. I also found this recipe which might help you: http://code.activestate.com/recipes/528868-extraction-and-manipulation-class-for-microsoft-ac/ -- Mike Driscoll ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7?
Gary L Smith wrote: I need to access data in an MS Access 2003 database using Python 2.5 or 2.6 running in Windows7. Windows7 doesn’t seem to have appropriate drivers for ODBC. My error messages consistently contain the phrase, “Data source name not found and no default driver specified.” While I see that others have run into the same problem, my web searches have only deepened my confusion – questions are routinely answered with suggestions that turn out to not work in Windows7. Suggestions such as SQL Alchemy or pyODBC don’t solve the problem, because it still boils down to the missing drivers. This is a volunteer effort, so even the Egenix product, mxODBC, at $69 is a little much. Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it’s just not possible, put me out of my misery. Do you have Access installed on this machine? That's always been one of the downsides of Access -- you have to have the Access run-time installed to use an Access database. Note that ODBC does not really have anything to do with Access. ODBC is just a generic database layer. If you don't have the Access runtime, then even mxODBC won't get you into the data. From the message, it sounds like you are getting into ODBC just fine, but there is no ODBC Access driver installed. Have you tried ADODB and direct DAO access? Both of them can be used with Access, although again without the runtime, I think you're in trouble. -- Tim Roberts, t...@probo.com Providenza Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7?
I think Tim's last suggestion is the way to go, and you should NOT need ACCESS installed. Microsoft invented ODBC. Everybody saw it was a great idea and adopted it. So Microsoft had to invent something even newer, which everybody else does not support. That's called ADO. ADO defaults to ODBC mode, so usually you can happily forget it is there, and use ODBC drivers for everything. But in native ADO mode, you don't use *drivers*, you use *providers*, (along with a connection string which is completely different from odbc.) The provider for Access-type data bases is called JET. It should be included on any NT-based Windows version. ACCESS is not required. The setup I use for testing ado's ability to read and write an ACCESS .mdb file is something like this: Python import adodbapi _databasename = Test.mdb constr = 'Provider=Microsoft.Jet.OLEDB.4.0; Data Source=%s' % _databasename _table_name= 'Products' #create the connection con = adodbapi.connect(constr) #make a cursor on the connection c = con.cursor() #run an SQL statement on the cursor sql = 'select * from %s' % _table_name c.execute(sql) #get the results db = c.fetchmany(5) #print them for rec in db: print rec print print 'repr() of next row is...' print repr(c.next()) print c.close() con.close() /Python Running the script (on my 32-bit Vista laptop with no Microsoft Office components installed) gives: console dump ('1', 'Widgit', '5.0', '15.1234', '2009-01-29 13:05:30') ('2', 'Thingamajig, Standard', '505.0', '0.1', '2009-01-29 15:05:19') ('3', 'Left Handed Smoke Shifter', '1.0', '100', '2008-04-01 12:00:00') ('4', 'Gravel (Bulk)', '100.25', '32.4567', '2009-01-29 13:05:31') ('5', 'Tube, Drinking, Plastic, For cold liquids', '50.0', '0.0013', '2009-01-29 13:05:32') repr() of next row is... SQLrow={ItemNumber:6, ItemName:u'Annoy-A-Tron', UnitsOnHand:1.0, CostPerUnit:Decimal('12.95'), LastOrdered:datetime.datetime(2009, 1, 29, 13, 5, 33)} /console dump --- Notes: * Test.mdb is in the /test folder of the adodbapi source distribution. * to get that fancy row object with the column names, you must be running the latest version of adodbapi from http://sourceforge.net/projects/adodbapi/. The version which ships with pywin32 at will just give a normal tuple -- until the next release of pywin32. * I could not locate a 64 bit Windows 7 box to test this on. I tried. Sorry. Please report back whether or not this works for you. -- Vernon On Mon, Jan 24, 2011 at 11:46 AM, Tim Roberts t...@probo.com wrote: Gary L Smith wrote: I need to access data in an MS Access 2003 database using Python 2.5 or 2.6 running in Windows7. Windows7 doesn’t seem to have appropriate drivers for ODBC. My error messages consistently contain the phrase, “Data source name not found and no default driver specified.” While I see that others have run into the same problem, my web searches have only deepened my confusion – questions are routinely answered with suggestions that turn out to not work in Windows7. Suggestions such as SQL Alchemy or pyODBC don’t solve the problem, because it still boils down to the missing drivers. This is a volunteer effort, so even the Egenix product, mxODBC, at $69 is a little much. Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it’s just not possible, put me out of my misery. Do you have Access installed on this machine? That's always been one of the downsides of Access -- you have to have the Access run-time installed to use an Access database. Note that ODBC does not really have anything to do with Access. ODBC is just a generic database layer. If you don't have the Access runtime, then even mxODBC won't get you into the data. From the message, it sounds like you are getting into ODBC just fine, but there is no ODBC Access driver installed. Have you tried ADODB and direct DAO access? Both of them can be used with Access, although again without the runtime, I think you're in trouble. -- Tim Roberts, t...@probo.com Providenza Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] odbc under windows 7? [SEC=PERSONAL]
If you run out of other options, I've successfully used comtypes on top of the ctypes module included in Python 2.5 2.6 to read write data in Access 2003 databases. Regards, Andrew MacIntyre. - These thoughts are mine alone! - Andrew MacIntyre Operations Branch tel: +61 2 6219 5356 Communications Infrastructure Division fax: +61 2 6253 3277 Australian Communications Media Authority email: andrew.macint...@acma.gov.au mailto:andrew.macint...@acma.gov.au http://www.acma.gov.au/ http://www.acma.gov.au/ Gary L Smith wrote: Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it's just not possible, put me out of my misery. NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] odbc under windows 7?
Dear Pythoners, I need to access data in an MS Access 2003 database using Python 2.5 or 2.6 running in Windows7. Windows7 doesn't seem to have appropriate drivers for ODBC. My error messages consistently contain the phrase, Data source name not found and no default driver specified. While I see that others have run into the same problem, my web searches have only deepened my confusion - questions are routinely answered with suggestions that turn out to not work in Windows7. Suggestions such as SQL Alchemy or pyODBC don't solve the problem, because it still boils down to the missing drivers. This is a volunteer effort, so even the Egenix product, mxODBC, at $69 is a little much. Are there suitable open-source codes to get at Access 2003 data in Windows7? Please point me in a productive direction, or, it it's just not possible, put me out of my misery. Cheers, Gary Smith ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32