Archive: How to register an SQL Server 2000 DSN?


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?


These should help:

http://forums.winamp.com/showthread....&highlight=dsn
http://nsis.sourceforge.net/archive/...php?pageid=106
http://nsis.sourceforge.net/archive/...php?pageid=387
http://nsis.sourceforge.net/archive/...php?pageid=390


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"


Could you point out the difference? Perhaps emphesize it with some color?
Thanks.


Last line it says:

ODB.ini instead of ODBC.ini