Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for script to add data source node to ODBC

Tags:

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.

like image 932
cnd Avatar asked Mar 09 '26 05:03

cnd


1 Answers

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.

like image 162
Garry M. Biggs Avatar answered Mar 11 '26 08:03

Garry M. Biggs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!