23

I'm looking for a library that allows node.js to connect to ODBC on windows. All the libraries I have found thus far seem to work with UnixODBC but not windows, can someone please suggest a library that will work with Windows?

leeand00
  • 25,510
  • 39
  • 140
  • 297

1 Answers1

21

Although the readme only mentions UnixODBC, this project: https://github.com/wankdanker/node-odbc will actually install and work on windows.

You can install it on windows with:

npm install odbc

but you will need the various requiements for building native modules on windows:

https://github.com/TooTallNate/node-gyp

jedigo
  • 901
  • 8
  • 12
  • 1
    For others, there is also: https://github.com/idobatter/node-win32ole which gives access to more than just odbc. It ALSO requires node-gyp however. – cmroanirgo Jan 22 '15 at 07:01
  • You also need Python installed –  May 11 '15 at 19:33
  • 2
    Works for me. Side note: I have a 32bit driver on a 64bit machine and encountered [ERROR|IM014|Microsoft|ODBC Driver Manager|The specified DSN contains an architecture mismatch between the Driver and Application](http://stackoverflow.com/questions/21395492/error-im014-microsoftodbc-driver-manager-the-specified-dsn-contains-an-arc). Solution: Run the 32bit version of NodeJS – bgerth Jun 15 '16 at 17:46
  • 1
    You'll likely need to rebuild odbc to work with your version of Electron. To do that, follow the steps here: https://stackoverflow.com/a/45930921/293280 – Joshua Pinter Aug 29 '17 at 04:56