Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

770 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