Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

BATCH file (*.bat) to create an ODBC machine data source

Posted on 2007-12-05
2
Medium Priority
?
2,192 Views
Last Modified: 2011-09-20
Hello,

I am trying to write a DOS Batch file (*.bat) that will perform the steps of creating an ODBC machine data source, has anyone done this before?

The goal is instead of walking people thru the steps of creating the data source, they can just run this BAT file.

Thanks!
0
Comment
Question by:hpsuser
2 Comments
 
LVL 9

Accepted Solution

by:
asawatzki earned 1500 total points
ID: 20416406
You can export the ODBC data source from the Registry.  It would be a subkey of one of the following keys:

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
HKEY_CURRENT_USER\Software\ODBC\ODBC.INI
HKEY_CURRENT_USER\Software\ODBC\ODBCINST.INI

Once it is exported into a .reg file you can use a batch file that does a command:

Reg Import c:\odbcsource.reg

If its a SQL source you would need to restart SQL to get it to recognize.
0
 

Author Closing Comment

by:hpsuser
ID: 31413017
thanks asawatzki
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
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…
Suggested Courses

971 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