Link to home
Start Free TrialLog in
Avatar of Frank De Carpenter
Frank De CarpenterFlag for Fiji

asked on

Using DSN to connect to SQL Server

I'm using VS2010 VB.net with SQL Server back end and would now like to start using Data Source to connect rather then coding credentials in appconfig. I'm also worried about exposing SQL passwords. Is there a safe way to do this and can you refer me to an example please.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The DSN for SQL Server does not contain credentials
Yes, it can
The DSN itself cannot (in ODBC Administrator). You can use credentials together with a DSN.
"Server=MSSQL1;Database=AdventureWorks;Integrated Security=true;" is no DSN.
Are we talking about the same thing?
User generated image
Shaun, that is a common misunderstanding. The credentials provided there are just for "Connect to SQL Server to obtain ...", and only used for the next setting dialog where you are able to provide the default database etc. Those credentials are not used for the connection itself later.
Hmmm, are you sure? I have migrated applications that break if you change authentication on DSN file...

Very good to know (and confusing) if this is the case
Indication is that the credential fields are only available if you check "Connect to SQL Server to obtain ...".
No, credentials only available if you select SQL authentication
That is another requirement. You can have checked SQL Authentication and still not checked "Connect to SQL Server to obtain ...", and the credentials are still locked from being entered.
Thank you, will test