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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 08/18/2009 by: VBScab
Red Belt

Please log in to comment
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 ?
Answered 08/18/2009 by: deepak_2007
Senior Yellow Belt

Please log in to comment
0
Sure, just write a custom action script to read the required ini file values and write them to the registry.
Answered 08/18/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
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 ?
Answered 08/18/2009 by: deepak_2007
Senior Yellow Belt

Please log in to comment
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
Answered 08/18/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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.
Answered 08/18/2009 by: VBScab
Red Belt

Please log in to comment
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.
Answered 08/18/2009 by: deepak_2007
Senior Yellow Belt

Please log in to comment
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.
Answered 08/18/2009 by: VBScab
Red Belt

Please log in to comment
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.
Answered 08/18/2009 by: deepak_2007
Senior Yellow Belt

Please log in to comment
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.
Answered 08/18/2009 by: VBScab
Red Belt

Please log in to comment
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.
Answered 08/18/2009 by: elgwhoppo
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity