Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does ODBC put in the registry?

Status
Not open for further replies.

denazn

Technical User
Feb 7, 2005
56
CA
The configuration:
I have 2 databases I want to connect to. Both are on SQL Server 2000. To switch between the two, users need to change the data source.

The problem:
When they switch from database 1 to database 2, a SQL Server login screen comes up and prompts for a SQL Server login and password.

I would like to know where that information is being stored, since we don't want to give out the password. If it's a registry entry, I'd like to have them run a batch file that updates the registry so they don't have to enter it in. Does anyone know where this could be stored?
 
I've never found out where that information is stored, if it is. It's not stored with the DSN in the ODBC area of the registry.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\data-source-name

For the user login name set the key named UID to the login name. For the password, set PWD to the password value.

Note, however: these registry keys are probably correct for SQL Server, but I don't really have a way to test it right now. Also, there is nothing very secure about storing a password in the registry, since you are relying on user ignorance of the storage mechanism.

Tom Morrison
 
k5tm,
Are you saying to add those keys to the registry under the DSN? I've never seen them stored there when using a SQL login to connect to the database.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I have.

I am operating under the presumption, which may be wrong, that the ODBC driver manager, which in theory knows nothing about the driver it is invoking, will place the UID and PWD keyword-value pairs in the SQLDriverConnect connection string. I do not have any direct experience with the ODBC driver for SQL Server, so it may be that the driver will not act upon those particular keyword-value pairs.

An experiment should quickly show if this will work. Then you can report back here for future reference, please.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top