?
Solved

using ODBCCONF.exe to make a System DSN entry

Posted on 2003-03-26
10
Medium Priority
?
5,514 Views
Last Modified: 2007-12-19
I want to create a batch file taht will register a system DSN for use with an ASP web app

basically

I need it to connect using SQL Server Driver
DSN = test
uid = test
pwd = pwd
Server = (local)
DB = test

And no other options

I've tried to get it in but the best I can do is register the system DSN as test but it is taking none of my other options
0
Comment
Question by:overlord64
[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
10 Comments
 

Expert Comment

by:tarnaigy
ID: 8210798
Hi!

Is there any specific reason that you want to use the ODBCCONF utility?

In my opinion it would be much easier to create a DSN "template" manually with the ODBC Data Source Administrator, then export the DSN's registry key into a .reg file via regedit (wich can be used to import the settings back into any Windows system). They can be found under the HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI key.

The import is also very simple. Ex.:

regedit /S myreg.reg

imports the .reg file silently into the registry.

Sometimes the simpliest solutions are the best. I hope I could help you out at least temporarly.
0
 

Author Comment

by:overlord64
ID: 8215297
That won't work as I need to edit the ODBC twice and would much rather do it via the odbcconf ... I just cna't figure out the attribute to use for user and pwd... the rest I can do
0
 

Author Comment

by:overlord64
ID: 8215304
as well the registry does not allow for me to change the password of the DSN entry which is the goal.

After the project is finished, the installation file will change the password to access the database as I am not to know what it is.

It takes it from the database (using initial DSN), modifies the ODBC connection to use the value pulled from the database and then deletes the installation user.

The best way I would like to do this is by odbcconf
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:overlord64
ID: 8215307
as well the registry does not allow for me to change the password of the DSN entry which is the goal.

After the project is finished, the installation file will change the password to access the database as I am not to know what it is.

It takes it from the database (using initial DSN), modifies the ODBC connection to use the value pulled from the database and then deletes the installation user.

The best way I would like to do this is by odbcconf
0
 

Author Comment

by:overlord64
ID: 8216554
using UID= and PWD = always gives me invalid keyword value pairs

until I remove the UID and PWD then it will work


basically I need to only know what those attributes are for SQL Server Driver


0
 

Expert Comment

by:tarnaigy
ID: 8216626
I'm not sure that the SQL Server driver allows you to set a password. SQL authentication can happen using a UID/PWD pair or NT authentication. In both cases it would be a serious security leak if you could set a password in ODBC to authenticate. If you store a PWD on the client (even coded) it's much easier to obtain it using reverse engineering or brute force cracking.

Try to exec ODBCCONF with only UID defined, see what happens.
0
 

Author Comment

by:overlord64
ID: 8222199
same thing ... invalid pairs...
Could be the security tho'...
I think it's mainly gonna have to be resolved with a manual change of the ODBC driver ...
0
 
LVL 17

Expert Comment

by:walterecook
ID: 10360553
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

walterecook
EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10391214
PAQed, with points refunded (75)

PashaMod
Community Support Moderator
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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
In this article, we’ll look at how to deploy ProxySQL.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

800 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