The ODBC API provides ways to enumerate both DSN (Data Sources) and ODBC Drivers, and it’s actually pretty easy to do once you know where to look. Here’s a sample that shows User and System DSNs installed on the system, as well as available drivers. It’s a full MFC application,but it’s pretty simple, and it’s UI is pretty simmilar to the ODBC configuration control panel applet. The App is written in VC++ 6.0, but should be easy to move to 5.0.
As a plus, the sample shows how to use a CPropertySheet as the app’s main window (instead of a dialog), and how to use parent classes based on MFC to add more code reusability, while keeping the ability to use ClassWizard to add message handlers.
Now, download the files from here