rajeshveerepalli / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Microsoft Access Connection string on diferrent python architectures. #203

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Perhaps this is not a bug, but I found it a bit counterintuitive. I run windows 
7 x64. The ODBC driver is 

MS Access Database : Microsoft Access Driver (*.mdb, *.accdb)

What i found peculiar is that in order to connect to an Access DB, I had to use 
different connections strings for python x86 and python x64. Pyodbc version 
2.1.9 and python 2.7.2

x86 : Microsoft Access Driver (*.mdb)
x64 : Microsoft Access Driver (*.mdb, *.accdb)

running the following script on python 2.7 results on the same output 
regardless of the architecture

>>> import pyodbc
>>> print pyodbc.dataSources()
{'MS Access Database': 'Microsoft Access Driver (*.mdb, *.accdb)',
'dBASE Files': 'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)',
'Excel Files': 'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, .xlsb)'}

Is this behavior normal? Is it possible to get somehow the correct driver from 
within pyodbc?

Original issue reported on code.google.com by pmav99@gmail.com on 23 Aug 2011 at 12:44

GoogleCodeExporter commented 8 years ago
This is the correct behavior, I believe.  ODBC drivers are DLLs, so 32-bit and 
64-bit would need to be different, but they might be registered in the same 
place.

I don't believe there is a way to get the list of drivers.  On Windows, it's in 
the registry.  Unix, Linux, and OS/X using configuration files.  It would be 
nice to have an API for that.

Original comment by mkleehammer on 13 Sep 2011 at 10:40