How to list all ODBC Data Sources?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How to list all ODBC Data Sources?

  1. #1
    Join Date
    Dec 2009
    Posts
    4

    How to list all ODBC Data Sources?

    I am trying to make a odbc connection utils. And in this application I want to retrive all my ODBC connections from the system-DSN and display them in my combobox.

    But I don't know if there is a sdk function(not MFC) can do this.

    Is there a function can do this? If no, how to get the list?

  2. #2
    Join Date
    Apr 2004
    Posts
    99

    Re: How to list all ODBC Data Sources?

    Quote Originally Posted by readsuhang View Post
    I am trying to make a odbc connection utils. And in this application I want to retrive all my ODBC connections from the system-DSN and display them in my combobox.

    But I don't know if there is a sdk function(not MFC) can do this.

    Is there a function can do this? If no, how to get the list?
    The system DSN's can be found in the HKLM\Software\ODBC\ODBC.INI\Odbc Data Sources registry key. Thus, you'll have to use registry functions such as RegOpenKeyEx, RegQueryValueEx etc. to retrieve the values.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,976

    Re: How to list all ODBC Data Sources?

    See the attached sample.
    Attached Files Attached Files
    Last edited by Igor Vartanov; December 14th, 2009 at 06:54 AM.
    Best regards,
    Igor

  4. #4
    Join Date
    Dec 2009
    Posts
    4

    Re: How to list all ODBC Data Sources?

    Thank you for your reply.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center