configuring ODBC DSN with a python script

Robert Brewer fumanchu at amor.org
Thu Feb 5 13:27:19 EST 2004


Jani Yusef wrote:
> I am building an application which, unfortunately, 
> *must* use an access db...
> how do I configure the ODBC dsn without having the
> user open up the ODBC control panel which will in
> all honesty just scare and confuse them. ;)

I opined:
> the thought crosses my mind that ODBC entries are merely a lump 
> of registry keys--you might just create or even copy those 
> programatically. That would be my first attempt.

and omission9 added:
> Below is some code which more or less implements this...

Great work! I knew *someone* must have tried that before. :)

> One thing is that the system dsn created works perfectly fine but for
> whatever reason doesn't show up in the odbc control panel. I am not
> very well versed in Windows specific programming so am not sure why
> that is but would like to know why. Anybody know why that is?

First guess: you need an entry in
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org




More information about the Python-list mailing list