Solved

Finding Data Source Name

Posted on 1999-01-20
3
175 Views
Last Modified: 2013-11-20
Dear Experts,
i want to list the dsn entries in my system in a combo box. From where i can read the dsn entries?. if they are in the registry, how can i retrive without knowing the registry key name
thanks in advance
regards
subbs
0
Comment
Question by:subbaiah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
MelissaC earned 20 total points
ID: 1328081
Hi Subbaiah,
The DSN on a machine can be found in the registry:
HKEY_LOCAL_MACHINE/SOFTWARE/ODBC.
If you use CRecordset::Open(...) without specifying a DSN, the Windows DSN-dialog (like in Control Panel) will be displayed so the user can choose a DSN by himself.
Hope this helps.
0
 
LVL 1

Author Comment

by:subbaiah
ID: 1328082
Hai MelissaC,
Thank u for ur reply, but i want to implement the same functionality for some other purpose, can u please give more details to read the dsn entries

0
 
LVL 2

Expert Comment

by:MelissaC
ID: 1328083
Hi Subbaiah,
take a look at:
http://www.codeguru.com/system/navigating_registry.shtml
there's a good explanation about the registry. I think the topic you need is iteration. (GetFist, GetNext, etc). This way you can find all subkeys of HKEY_LOCAL_MACHINE/SOFTWARE/ODBC.
Good luck!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question