cnd
cnd

Reputation: 33714

Looking for script to add data source node to ODBC

I'm making installation script and I'm using ODBC, how can I automatically add a node to ODBC Data Sources.

Building installer with Visual Studio setup project, but I'm able to run any script for it.

Thank you.

Upvotes: 3

Views: 740

Answers (1)

Garry M. Biggs
Garry M. Biggs

Reputation: 46

1)

ODBC Data Sources are typically defined in registry entries - located at -

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI...... (DSNs on 32bit Windows or 64bit Windows)

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI...... (DSNs on 64bit Windows for 32bit Drivers)

That part of the registry contains the "System" DSNs - HKEY_CURRENT_USER contains "User" DSNs.

Of course, all drivers are different so there may be additional stuff required elsewhere too...

2)

You could also consider using File DSNs and ship the fie with the installer.

3)

You could also consider a DSN'less connection - but this would depend on how the ODBC application is coded.

Upvotes: 2

Related Questions