Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-12-05
2
Medium Priority
?
2,175 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
[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 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 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