Solved

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

Posted on 2007-12-05
2
2,147 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 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

739 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