I am trying to establish a connection between nodejs project and server running Microsoft SQL Server 2005. I am using a node module mssql
, but I get these errors when I am attempting to create a connection:
{ [ConnectionError: Failed to connect to 123.123.12.1:1433 in 15000ms]
name: 'ConnectionError',
message: 'Failed to connect to 123.123.12.1:1433 in 15000ms',
code: 'ETIMEOUT' }
My connection being made by
var sql = require('mssql');
var dbConfig = {
server:'123.123.12.1',
database:'testingDB',
user:'userName',
password:'pass',
port:1433
};
function getEmp() {
var conn = new sql.Connection(dbConfig);
var req = new sql.Request(conn);
conn.connect(function(err) {
if(err) {
console.log(err);
return;
}
else {
console.log('success');
}
});
}
getEmp();
I am not sure what I am doing wrong, I am using a cloud 9 IDE if that helps.