How would I go about geting a list of datasources on the local PC?
Printable View
How would I go about geting a list of datasources on the local PC?
They are stored in the registry:
This will get system DSNs, if you want to get user DSNs, just change from LocalMachine to CurrentUser.Code:Dim DSNs As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", False)
For Each value As String In DSNs.GetValueNames
ComboBox1.Items.Add(value)
Next
thanks alot!
You must spread some Reputation around before giving it to Negative0 again.