Solved

programatically install an ODBC entry including password?

Posted on 2014-02-07
5
371 Views
Last Modified: 2014-03-17
Hi

I can easily use the ODBC control panel in Windows to setup an ODBC connection, including the entry of a password followed by the "test connection"..   I'm referring to SQL Native Client 10, and SQL Server Authentication mode.

I know how programmatically (VB/C#/C++) add an ODBC entry to the registry, but this doesn't include the password.

Is it possible to write a small program (compiling the password into the code) that will setup the ODBC registry entry and add the password? This is a utility app for some service folks and I want them to be able to configure and verify the ODBC connection without having to inform them of the password.

Can this be done?

Thanks
0
Comment
Question by:PMH4514
  • 3
5 Comments
 
LVL 32

Expert Comment

by:Big Monty
ID: 39842140
according to this thread, this cannot be done due to the fact that it is very insecure.
0
 

Author Comment

by:PMH4514
ID: 39842163
But if the windows API can do it (ie. the ODBC tool in Admin Tools) certainly there must be a way I can make a program do the same thing?  (how would anybody ever make a program installer that uses ODBC if this wasn't possible?)
0
 
LVL 18

Accepted Solution

by:
Dennis Aries earned 250 total points
ID: 39874791
http://stackoverflow.com/questions/334939/how-do-i-create-an-odbc-dsn-entry-using-c might be what you are looking for. Very extensive class but easy to use.
0
 

Author Comment

by:PMH4514
ID: 39874811
Thank you I will look into this.
0
 

Author Comment

by:PMH4514
ID: 39882416
That is an interesting class, but unless I'm missing something, it still does not allow the application of a password..
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now