Solved

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

Posted on 2009-05-08
2
426 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

Industry Leaders: 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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

756 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