NsODBC plug-in
From NSIS Wiki
Jump to navigationJump to search
Author: sl (talk, contrib) |
Description
nsODBC is NSIS ODBC Configuration Manager. Works over odbcinst32.dll. Based on SQLInstall Win API.
Download Link
NsODBC.zip (7 KB)
NsODBC-unicode.zip (8 KB)
Methods
::AddDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::AddSysDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::ConfDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::ConfSysDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::RemoveDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::RemoveSysDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ... ::RemoveDefDSN ;[DriverName] Parameters pairs follows: [DSN=XXX] [UID=0x777] ...
Example Scripts
; Create MS Access DSN & Data Base nsODBC::AddSysDSN "Microsoft Access Driver (*.mdb)" "DSN=SERVER_${PRJ_NAME}_DB" "DBQ=$INSTDIR\${PRJ_NAME}.mdb" ; Remove DSN nsODBC::RemoveSysDSN "Microsoft Access Driver (*.mdb)" "DSN=SERVER_${PRJ_NAME}_DB"
It is also possible to create, compact, and repair Microsoft Access mdb files with this plugin. A link below explains the syntax for compacting and repairing the database. Notice: Be sure to put the path to the database file in escaped quotes as the command will fail if there are spaces in the file name otherwise.
; Create a JetSQL (mdb) file. nsODBC::AddDSN "Microsoft Access Driver (*.mdb)" "CREATE_DB=$\"$INSTDIR\foo.mdb$\" General"
References
MS Knowledge base article that demonstrates CREATE_DB, REPAIR_DB, and COMPACT_DB