Closed
Description
Trying to connect a locally-running application to a remote ms sql database using the following standard code.
The error is coming from connector.js line 31. Are they any more dependencies I would need to install?
var sql = require('mssql');
var config = {
user: '*******',
password: '******',
server: '****',
database: '**',
port: 1433
};
// connect to your database
sql.connect(config).then(() => {
return sql.queryselect * from TestTable
}).then(result => {
console.log(result);
}).catch(err => {
// ... error checks
console.log("Connection Error");
console.log(err);
})
sql.on('error', err => {
// ... error handler
console.log(err);
})
sql.close();
Metadata
Metadata
Assignees
Labels
No labels