I'm getting the "Database connection failed" trying with the Node.JS driver for SQL and the example from: http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx
The string I use against SQL Server Express 11.0 64-bit, local
var conn_str = "Driver={SQL Server Native Client 11.0};Server=(local);Database=MyDB;Trusted_Connection={Yes}";
I also tried "sa" and another local user vs Windows Authentication -- all without luck.
Running node 0.6.10 (the version supported by the SQL driver), SQL Server Config showing SQL Native Client 11, so the versions match.
Are there any ways to troubleshoot?? Any guides / tutorials where the connection was successful for my stack?
RESOLVED:
I had been trying to incorrectly access the named instance of SQL Express. Should be .\\SQLEXPRESS
, not (local) or .\SQLEXPRESS
.
The correct String:
var conn_str = "Driver={SQL Server Native Client 11.0};Server=.\\SQLEXPRESS;Database=NPv1;Trusted_Connection=Yes";