Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to open ODBC Administrator from C#

Posted on 2012-08-16
3
Medium Priority
?
1,175 Views
Last Modified: 2012-08-17
Greetings,
I am programming a C# application where someone can use a DSN on the computer to connect to a database.  I have the ability to find all system and user-based DSNs, and allow the user to select an existing DSN, and move forward from there....no problems.


My issue is Setup of a new odbc connection.  How do I open the control panel's ODBC Administrator to create a new one using the wizard?

I'd like to assign a button to it.

Thanks
0
Comment
Question by:Evan Cutler
3 Comments
 
LVL 12

Accepted Solution

by:
rajapandian_81 earned 2000 total points
ID: 38303653
Hi,

If you would like to launch "ODBC Data Source Administrator", try the following code:
System.Diagnostics.Process.Start(Environment.GetEnvironmentVariable("SystemRoot") + @"\system32\odbcad32.exe");

Open in new window


If you want to add DSN entry using C#, refer:
http://stackoverflow.com/questions/334939/how-do-i-create-an-odbc-dsn-entry-using-c
http://www.codeproject.com/Tips/350601/Create-SQL-DSN-in-Csharp
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38304612
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 38304620
That did it.
Thanks Much :)
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

571 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