Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

programatically install an ODBC entry including password?

Posted on 2014-02-07
5
Medium Priority
?
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 33

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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