HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Can a username and password be hard-coded in a system DSN

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
cancodedsystemhardpasswordusernamedsnand

Problem

We have a legacy CRM that uses a DSN with Windows Authentication to connect to an instance of SQL Server 2005 (part of SBS 2003 Premium). We will soon be doing a major migration leaving us without a Windows Domain - as I understand things, that will mean we need to use an alternative authentication method. We are also planning to migrate from the SQL Server 2005 to SQL Server Express 2008 R2 in the same timeframe.

Unfortunately no modifications to the CRM are possible.

Leaving aside the obvious security issues, is it possible to hard-code a username and password in a system DSN? Alternatively is that another obvious approach to authentication that I am missing?

--EDIT

The DSN is defined in the ODBC Data Source Administrator in the "Administrative Tools" section of the Control Panel on the Windows clients.

--EDIT 2

I gave up trying to do this in the DSN thanks to Jonathan's answer. Fortunately I discovered an .ini file where I could insert a fixed username/password replacing the placeholders - problem solved.

Solution

A System DSN is stored in the registry and does not have the ability to store a password. If you want to store the password, you'd have to use a File DSN and that would require changing the CRM to use the file DSN which you say is not possible. Usually applications that use a System DSN, rely on SQL Server authentication of the users for their security. When the application opens it should prompt the user to login, and this is the username and password that is used with the System DSN information to connect to the database server. If the DSN uses Windows authentication and you are eliminating your Windows Domain, you are stuck. You would have to change the CRM to make it work a different way.

Context

StackExchange Database Administrators Q#2910, answer score: 7

Revisions (0)

No revisions yet.