Solved

Microsoft Command or VB.NET script to create new ODBC system connection

Posted on 2009-05-08
2
427 Views
Last Modified: 2012-05-06
Hi all,

I need to show the "new odbc system dsn creation windows screen" by using command or a script.

By entering the odbcad32 to command prompt,the ODBC settings main screen will popup.What i need to show is the Add new System DSN screen.It can be either the cmd windows command or a specialized VB.NET script.

Thanx
0
Comment
Question by:AGullen2
[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
2 Comments
 
LVL 16

Accepted Solution

by:
ToddBeaulieu earned 500 total points
ID: 24338284
I haven't worked with DSNs in a decade, I'd say. I don't know if you can hook into the add dialog easily. Can you create your own dialog (or get the values automatically) and then call into the ODBC API to create it? Seems like a better approach since you know exactly what's going on and if it was successful.

http://www.scribd.com/doc/8477127/Programmatically-Adding-a-DSN-to-a-Machine-Using-VBnet
0
 

Author Comment

by:AGullen2
ID: 24352934
The code you mentioned is using ODBC.INI file if i'm not mistaken ,however this file is not used in every OS, especially the new ones.

I've asked another question while i asked this one,have a look at that too:

http://www.experts-exchange.com/Programming/Languages/.NET/Q_24391921.html

Besides i have to use this code not only between SQL Server and other sources but use it between Access and various sources,so i'm not sure if i can use the sqlconfigdatasource for non sql server connections.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

738 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