Getting a list of odbc drivers available on Windows 7 using python
I realize this is a late answer ... but stumbled upon the answer myself; in case anyone else is looking for an answer.
pyodbc
has a method that returns a list of installed ODBC drivers. Of course, this is just a list of driver names, so it is a little awkward to match the most recent driver, but hopefully this helps.
I am using regex (via inline module re
) to filter out the driver I want.
import pyodbc
pyodbc.drivers()
The output provides a list of installed ODBC drivers.
source to share
There is nothing built into Python that will allow you to do this, except perhaps to do something really ugly with ctypes and I'm not sure if that would work. However, you can probably do it with Tim Golden's wmi.py module.
I found examples of using WMI to find common drivers:
So you probably have to filter the list in some way.
source to share