?
Solved

Batch File to Remove ODBC Connection

Posted on 2011-10-18
7
Medium Priority
?
2,430 Views
Last Modified: 2012-05-12
I've figured out how to create an ODBC connection through a batch file that
runs like this:

ODBCConf ConfigSysDSN "MySQL ODBC 5.1 Driver" "DSN=test;SERVER=cpucnd1277xr9.mycompany.com;UID=%USERNAME%;PWD=today123;DATABASE=arms;PORT=3306"

Open in new window


I'm trying to figure out how to delete this connection through the same process.
Thanks,
-JW
0
Comment
Question by:JustinW
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Expert Comment

by:coolfiger
ID: 36986424
0
 
LVL 8

Expert Comment

by:coolfiger
ID: 36986481
i believe u jsut need to use the instodbc utility and write the necessary code in a batch file
0
 
LVL 1

Author Comment

by:JustinW
ID: 36986541
The delete portion of the batch file is going to be run by a lot of different computers.
Is instodbc a native windows utility?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 66

Accepted Solution

by:
johnb6767 earned 2000 total points
ID: 36986578
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<DSNNAME>" /f

All you need to do. HKCU for a User DSN....
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36986584
Reason I suggested that, was is that its just a simpler method, instead of the above.....
0
 
LVL 1

Author Comment

by:JustinW
ID: 36986635
@john,

How to remove from //ODBC Data Sources?

When I go to odbc source admin, it still lists 'TEST' as an active ODBC
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36986992
Should be gone after a reboot.....
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
Suggested Courses

569 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