Discussion Locked

How to get server name, Login & if possi

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want to get the server name , login and password from the DSN that has been created for a particular database. I want read this info and displayed on to a form. Is it possible?? Or any another way to get this info. I am using VB programming for this.

2 replies

by jeff

All ODBC DSN properties are stored in the registry keys hkey_local_machine\software\odbc\odbc.ini (for system DSNs) and hkey_current_user\software\odbc\odbc.ini (for User DSNs). File DSNs are stored in the file system and can be read directly from a file; the default DSN location is in hkey\local_machine\software\odbc\odbc.ini\ODBC File DSN\DefaultDSNDir. You can simply use the VB registry functions to get the information you want and display it on your form. Most drivers will not store the password as plain text in the registry, though, so you may not be able to get that. Good luck!

This discussion is closed to new replies.