Python - database connectivity in a Windows environment
How to connect to a database in a Windows environment using Python.
There are a bunch of modules that promise to get you there including odbc, and the others on the Python Database Modules page at Python.org. These all have some shortcomings- the most obvious looking approach would seem to be the odbc module, but I couldn't find a way to get it to give me the names of fields. Other modules weren't included with ActiveState's Python distribution and/or were poorly documented.
The most flexable way I've found is outlined here and involves using the win32com module. Your code won't transfer to a Linux box without lots of work, but if you don't think you'll be moving from Windows, this could be the way to go. It's a direct translation of ADO which means there are ties into just about everything you can do with a database on Windows.
The most flexable way I've found is outlined here and involves using the win32com module. Your code won't transfer to a Linux box without lots of work, but if you don't think you'll be moving from Windows, this could be the way to go. It's a direct translation of ADO which means there are ties into just about everything you can do with a database on Windows.

