/build/static/layout/Breadcrumb_cap_w.png

Read ODBC information from an INI

Hi ,

ODBC information for a particular connection is stored in a particular INI file.I need to read those values from INI file and write it to ODBC registry value.To be precise : I have to read Username and password of a particular ODBC from an INI which is placed in rootdrive.I have to write these values in relevant ODBC registries.
INI looks like

[ODBCINFO]
user= ..
Password= ..

Any help will be appreciated.

0 Comments   [ + ] Show comments

Answers (11)

Posted by: anonymous_9363 14 years ago
Red Belt
0
Somehow, I don't think database passwords are stored in clear text in the ODBC registry entries. You will need to get that from the user somehow, either running in UI or from the command line.
Posted by: deepak_2007 14 years ago
Senior Yellow Belt
0
Lets say ..I just need to read the user information from the INI and import the value to registery .Is there any way to do that ?
Posted by: MSIPackager 14 years ago
3rd Degree Black Belt
0
Sure, just write a custom action script to read the required ini file values and write them to the registry.
Posted by: deepak_2007 14 years ago
Senior Yellow Belt
0
Thanks Rob, That can be done but would appreciate if you could point me to a written custom action coz of my low grip in VB and wise script.

But I am still bothered about ODBC password field. Does this field always remains a manual step ?
Cann't password be set in a INI and read to write in registery ?
I am talking about system DSN so the password must be same for all Users logging in.

Also , cann't ODBC connection through Wise set a password ?
Posted by: cygan 14 years ago
Fifth Degree Brown Belt
0
But I am still bothered about ODBC password field. Does this field always remains a manual step ?

first of all your odbc entries.

do you not access to odbc32.exe where you can create the required odbc settings
for sure you must have the required username and password to create the odbc settings

passwords are not stored in the registry when you create odbc connections
Posted by: anonymous_9363 14 years ago
Red Belt
0
A clarification: You can store a password in the registry for a System DSN, in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\[DSN_Name]\Password

As for a script, PM me with a detailed requirement and I'll send you a quote. No-one works for free.
Posted by: deepak_2007 14 years ago
Senior Yellow Belt
0
Rob . this reg value doesn't work.

@cygan --> cann't we make Username , password a part of INI from where ODBC would automatically pick up values.
Posted by: anonymous_9363 14 years ago
Red Belt
0
Further research (Ha! Imagine that! Actually researching a problem. What's wrong with me?) indicates that the reading of the p/w from the registry, even for a System DSN, is dependent on the ODBC driver used. Most SQL Server drivers ignore this entry, apparently.
Posted by: deepak_2007 14 years ago
Senior Yellow Belt
0
Thanks Rob for digging so deep ; perhaps a .NET or java exe can be called from custom action which would read the value from INI file and directly assign it to DB.
Posted by: anonymous_9363 14 years ago
Red Belt
0
...making the process even more complicated! You're still left with the problem of getting the password from the user, whether it's script, Java, .Net or divine invocation.
Posted by: elgwhoppo 14 years ago
Senior Purple Belt
0
Deepak, You still haven't specified what kind of ODBC entry this is. If it's a SQL DSN there is no way to store user name and password information in the registry. It either needs to be integrated authentication or SQL authentication. Integrated uses the current logged on user and SQL authentication uses the security accounts set up on the SQL server, and the application needs to pass the username and password to the server.

Why don't you just create the DSN manually and look in the registry to see what it is actually storing? I hate to be the one wheeing in your cheerios, but the concept of using cleartext username and password values in an INI file for DSN creation is a rather poor solution. If the app vendor supports it use integrated authentication.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ