Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Get DSN list?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] [2005] Get DSN list?

    How would I go about geting a list of datasources on the local PC?

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2005] Get DSN list?

    They are stored in the registry:

    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
    This will get system DSNs, if you want to get user DSNs, just change from LocalMachine to CurrentUser.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: [RESOLVED] [2005] Get DSN list?

    thanks alot!

    You must spread some Reputation around before giving it to Negative0 again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width