Cita:
Iniciado por Carlangueitor ¿Y el código?
Este es el que ejecuto "Server.js:
var sql = require('mssql');
var config = {
user: 'sa',
password: 'a',
server: 'MAQUINA', // You can use 'localhost\\instance' to connect to named instance
database: 'PRUEBA',
stream: true, // You can enable streaming globally
options: {
encrypt: true // Use this if you're on Windows Azure
}
}
sql.connect(config, function(err) {
// ... error checks
var request = new sql.Request();
request.stream = true; // You can set streaming differently for each request
request.query('select * from SampleUsers'); // or request.execute(procedure);
request.on('recordset', function(columns) {
// Emitted once for each recordset in a query
});
request.on('row', function(row) {
// Emitted for each row in a recordset
});
request.on('error', function(err) {
// May be emitted multiple times
});
request.on('done', function(returnValue) {
// Always emitted as the last one
});
});
-------------------------------------------------------------------------------
La estructura de la carpeta Nodejs2:
node_modules
server.js
*** El error es: ENOTOPEN (ConnectionError) - Connection not yet open.