Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

programatically install an ODBC entry including password?

Posted on 2014-02-07
5
Medium Priority
?
393 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 34

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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

877 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