System DSNs are in stored in the registry under
HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources, User DSNs are under
HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
It's relatively straightforward to get code to read from the registry (see,
for example, http://www.thescarms.com/vbasic/registry.asp) Once you have the
list of possible DSNs, you can either concatenate them together and use that
concatenated string as the RowSource for the combobox or (more likely, since
the RowSource property has a relatively small size restriction on it) create
a call-back function that you can use to populate the combobox. See http://msdn.microsoft.com/library/en-us/vbaac10/html/acproRowSourceTypeFunctionParameters.asp
for details about the call-back function.
Hi again,
I know how to fill the combobox but I need some example of code to
read/write to the winregistry in this case to read the list of DSNs it was
not easy to understand from the http://www.thescarms.com/vbasic/registry.asp