2

I'm new to Nodejs and I have to implement some changes in an small project. It runs over Sql Server using seriate module. I throws this error...

Seriate SqlContext Error. Failed on step 'connecting'.Failed to connect to 127.0.0.1:undefined in 15000ms

when executing a getPlainContext() with the following config object:

{
    "user": "node",
    "password": "node",
    "server": "127.0.0.1\\SQLEXPRESS",
    "database": "lms-db-dev"
}

I already tryied using (local)\\SQLEXPRESS which I'm using on my Web.config file connection string:

Server=(local)\SQLEXPRESS;Database=lms-db-dev;user id=node; password=node

I'm wondering why it tryies to connect to 127.0.0.1:undefined and how can I fix this.

DontVoteMeDown
  • 21,122
  • 10
  • 69
  • 105

2 Answers2

2

The problem is that the driver doesn't works with instance name, but Ip/port only. So I removed the instance name and added the port property on the config object with my local server's port, following this answer. My config object becames this:

"db": {
    "user": "node",
    "password": "node",
    "server": "127.0.0.1",
    "database": "lms-db-dev",
    "port": "52519"
}
Community
  • 1
  • 1
DontVoteMeDown
  • 21,122
  • 10
  • 69
  • 105
1

I had to turn on the SQL Server Browser service to get Seriate to work with the instance name.

SQL server configuration manager

bummi
  • 27,123
  • 14
  • 62
  • 101
DecaFade
  • 11
  • 1