I’m not trying to create an ODBC connection to be used in my application. I am working with another scripting language (I have no choice) that uses a local ODBC connection defined in odbcad32 (the Microsoft ODBC Source Administrator). I want to programmatically change the server in in odbcad32, and then call the script to do what it does, using the new information.
Share
I’m not sure if this is the best way, but you can simply create a .dsn file in the directory where your File Data Sources are kept. In my case that is C:\Program Files\Common Files\ODBC\Data Sources.
The files are just text files that look something like this: