I have an Excel application in which I want to present the user with a list of the Data Source Names (ie: DSN’s), whereby s/he can choose what data source to use.
Hopefully once I’ve got the list, I can easily access the DSN properties to connect to the appropriate database.
Please note, I do not want to use a DSN-less connection.
The DSN entries are stored in the registry in the following keys.
This contains the list of all defined DSN. This acts as an global index and the specific details for each DSN are stored in a key with the DSN name under:
Create some entries in both User DSN and System DSN tabs from Data Sources (ODBC) control panel applet and check how these values are stored in the registry.
The following example enumerate the DSN defined for the user trough Control Panel > Administrative Tools > Data Sources (ODBC) [User Dsn Tab].
http://support.microsoft.com/kb/178755