node-sqlserver-unofficial icon indicating copy to clipboard operation
node-sqlserver-unofficial copied to clipboard

Older native clients?

Open neverfox opened this issue 11 years ago • 6 comments

Any idea if this will work with older Native Clients like 9 if the connection string is set up properly? I'm working with SQL Server 2005 and would really love to be able to access it directly from node.js.

neverfox avatar Mar 26 '14 20:03 neverfox

I haven't the faintest idea I'm afraid! I only tested this with Azure. The README for the microsoft project specifically says native client 11.0.

Do report back! Maybe we can add a note on the README for this project specifying the minimum version.

jorgeazevedo avatar Mar 26 '14 21:03 jorgeazevedo

Okay, I'll test it out.

neverfox avatar Mar 26 '14 21:03 neverfox

No go. It said it couldn't load the binaries even though I'm on v0.10. However, I was able to build the official (after the necessary patches) and it works as long as I mention the right driver in the connection screen. So yours should be compatible with older versions in theory.

neverfox avatar Mar 27 '14 00:03 neverfox

Hmmm. I didn't touch the original code I think. Can you explain what you had to patch and how you found out? Can you show the diff? I'm thinking maybe we can recompile all the binaries so they're compatible with current and older native clients.

jorgeazevedo avatar Mar 27 '14 14:03 jorgeazevedo

I had to:

  • Fool install.js into downloading the v0.8 file from M$, rather than using my version (v0.10) which doesn't exist there. I wonder if the fact that I hadn't involved this downloaded file before on my machine has to do with why I couldn't get your binary to work.
  • Add 'libraries' to the 'conditions' section of binding.gyp:
      'conditions': [
        [ 'OS=="win"', {
          'defines': [
            'UNICODE=1',
            '_UNICODE=1',
            '_SQLNCLI_ODBC_',
          ],
          'libraries': [
            'odbc32.lib'
          ],
          }
        ]
      ]

After that, I just made sure my connection string began with Driver={SQL Server Native Client 10.0}; since that's what I had on my box.

neverfox avatar Mar 27 '14 21:03 neverfox

  • You did something like this? I actually don't remember what these .msi files are about. I might be missing a dependency on the list in the README. Can you confirm that my driver still doesn't work on your system?
  • Hm. Never heard of this one. I have no idea what that does.

jorgeazevedo avatar Mar 31 '14 14:03 jorgeazevedo