Skip to content
⌘ NSIS Forum Archive

How to register an SQL Server 2000 DSN?

5 posts

Skygod#

How to register an SQL Server 2000 DSN?

Have found references to use BdeInst.dll for register an DSN from the installation prg, but no example for SQL Server 2000?

Anyone?
kichik#
These should help:

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.



Skygod#
Thanks a lot, now it works! There was a typing error on the last link where it said:

WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Driver" "C:\\WINNT\\System32\\SQLSRV32.dll"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Server" "Server Name"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Database" "db on sql server"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "LastUser" "sa"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODB.INI\ODBC Data Sources" "DSNNAME" "SQL Server"

But it should be:

WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Driver" "C:\\WINNT\\System32\\SQLSRV32.dll"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Server" "Server Name"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "Database" "db on sql server"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\DSNNAME" "LastUser" "sa"
WriteRegStr HKEY_LOCAL_MACHINE "Software\ODBC\ODBC.INI\ODBC Data Sources" "DSNNAME" "SQL Server"