Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting text file to xml Pin
c0711-Jan-06 13:59
c0711-Jan-06 13:59 
AnswerRe: Converting text file to xml Pin
Stephen Hewitt11-Jan-06 20:41
Stephen Hewitt11-Jan-06 20:41 
AnswerRe: Converting text file to xml Pin
FarPointer12-Jan-06 4:11
FarPointer12-Jan-06 4:11 
AnswerRe: Converting text file to xml Pin
c0712-Jan-06 16:14
c0712-Jan-06 16:14 
QuestionHow to dynamically retrieve ODBC parameters through code? Pin
Priya..k11-Jan-06 5:08
Priya..k11-Jan-06 5:08 
AnswerRe: How to dynamically retrieve ODBC parameters through code? Pin
Koushik Biswas11-Jan-06 16:10
Koushik Biswas11-Jan-06 16:10 
GeneralRe: How to dynamically retrieve ODBC parameters through code? Pin
Priya..k11-Jan-06 22:23
Priya..k11-Jan-06 22:23 
AnswerRe: How to dynamically retrieve ODBC parameters through code? Pin
Koushik Biswas12-Jan-06 5:48
Koushik Biswas12-Jan-06 5:48 
Aha! So you are trying to retrieve username and password for one or more DSN-s programmatically. I do not know your purpose, but providing you with a way of doing that is like providing a mechanism by which anybody can hack into a database and wreck havoc with privacy! Suspicious | :suss: How can you expect that the password will just be stored somwhere where you can go and pick it up from? If it is easy like that, it beats the purpose of a "password" doesn't it?

Now here is what you can do: DSN entries are all stored in the registry under either HKCU\ Software\ ODBC\ ODBC.INI or HKLM\ Software\ ODBC\ ODBC.INI (depending on whether they're User or System DSNs). You just have to read the correct registry key (key name = DSN Name). If you run regedit and drill down to that location, you will see all your DSN-s listed. For any DSN, the values listed are all or some of these:

Database, Driver, LastUser, Server, Trusted_Connection...

But Password is not stored in the registry. You cannot get the password. As I told you, Microsoft won't be in business long if they provided you a way of getting to that! I am sure the password is stored somewhere encrypted - even if you knew the location, you probably have to retrieve the encryption key to decrypt it. And on top of that, your executable would probably need to set administrative privileges for itself to do any of that.





Koushik Biswas
QuestionSerial Presence Detect Pin
André Ziegler11-Jan-06 4:46
André Ziegler11-Jan-06 4:46 
QuestionIStream class Pin
LCI11-Jan-06 4:17
LCI11-Jan-06 4:17 
AnswerRe: IStream class Pin
Stephen Hewitt11-Jan-06 15:28
Stephen Hewitt11-Jan-06 15:28 
QuestionDigital I/O and ActiveX Pin
sweep12311-Jan-06 3:57
sweep12311-Jan-06 3:57 
AnswerRe: Digital I/O and ActiveX Pin
James R. Twine11-Jan-06 5:15
James R. Twine11-Jan-06 5:15 
QuestionSinh Calculator Pin
Dylan06038811-Jan-06 3:42
Dylan06038811-Jan-06 3:42 
AnswerRe: Sinh Calculator Pin
Russell'11-Jan-06 4:17
Russell'11-Jan-06 4:17 
GeneralRe: Sinh Calculator Pin
Russell'11-Jan-06 4:38
Russell'11-Jan-06 4:38 
AnswerRe: Sinh Calculator Pin
Prakash Nadar11-Jan-06 4:39
Prakash Nadar11-Jan-06 4:39 
JokeRe: Sinh Calculator Pin
Eytukan11-Jan-06 4:49
Eytukan11-Jan-06 4:49 
GeneralRe: Sinh Calculator Pin
toxcct11-Jan-06 6:21
toxcct11-Jan-06 6:21 
GeneralRe: Sinh Calculator Pin
Eytukan11-Jan-06 20:02
Eytukan11-Jan-06 20:02 
General'1'... Pin
toxcct11-Jan-06 21:19
toxcct11-Jan-06 21:19 
GeneralRe: '1'... Pin
Eytukan11-Jan-06 21:52
Eytukan11-Jan-06 21:52 
GeneralRe: '1'... Pin
toxcct11-Jan-06 22:03
toxcct11-Jan-06 22:03 
GeneralRe: '1'... Pin
Eytukan11-Jan-06 22:17
Eytukan11-Jan-06 22:17 
GeneralRe: Sinh Calculator Pin
Eytukan11-Jan-06 22:01
Eytukan11-Jan-06 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.