Hello, I am trying to connect to a SQL database on the same network as I but when I try and create a connection object I get a Socket is not a constructor: TypeError
error.
This is practically my code:
var Connection = require('tedious').Connection;
var dbConfig = require("./dbConfig.json");
module.exports = function ($scope, $location, SQLService, AlertService) {
$scope.Submit = function () {
var connection = new Connection(dbConfig);
};
};
I get the error on the new Connection
line and my config looks something like this, the values have been changed.
{
"userName": "nokel81",
"password": "nl4vsc54ykpPurt",
"server": "10.10.6.6",
"options": {
"port": 52581,
"database": "E1Q_API",
"instancename": "sql2k12"
}
}