1
votes

When my machine is reimaged or swapped out, I have to take a screenshot of each Data Source in my the Microsoft ODBC Administration tool to make sure I get it right on the new machine. Even going to a coworker's machine, using their settings might not work to connect to the same data sources because we might have different configurations (annoying, to say the least). Rather than taking a screenshot, there must be a way to output all those settings to a text file. Searching for an answer to my question gets me a lot of set-up answers and nothing that just outputs the current settings and configuration. I did find one that might help, if the values are listed in the registry file (http://stackoverflow.com/questions/3417142/command-line-to-change-path-to-mdb-file-for-ms-access-odbc-system-dsn)

Ideally, I'd like to use a batch file or vbscript. I'd like to see the text file say something like:

USER DSN

Data Source Name: MS Access Database

Driver: Microsoft Access Driver

Description:

Database: X:\Path\to\file.mdb

System Database: None

Driver Page Timeout: 5

Driver Buffer Size: 2048

Driver Exclusive: false

Driver Read Only: false

Default Authorization Username:

and so forth...

SYSTEM DSN

Data Source Name: data_warehouse

Driver: Adaptive Server IQ 12

Description:

... including other tabs like this ...

Database Server Name: data_warehouse

Database Start Line:

and so forth...

1

1 Answers

1
votes

You could export the registry entries for odbc to a file and import it on the other machines e.g. on my Windows 7 64 bit machine the system data sources are in HKEY_LOCAL_MACHINE\Software\ODBC\odbc.ini. If you only want selective ones you can easily edit the exported file.

Alternatively, you could move to using file dsns. With file dsns you put all the settings for the DSN in a file and connect using FILEDSN=path_to_file instead of DSN=dsn_name.