tediousjs / tedious

Node TDS module for connecting to SQL Server databases.

Home Page:http://tediousjs.github.io/tedious/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HELP:Unable connect to SQL Server 2000;

GillZhou opened this issue · comments

  1. TCP/IP is enabled and TCP Port 1433
    image

  2. SQL Server is running
    image

  3. SQL Server Agent is running
    image

4.Set tdsVersion '7_1'
image

var connection = new Connection(config);
image

Hi GillZhou, I do not currently have a SQL server 2000 set up on hand, but I have tried your connection configuration setting, and I can connect to my local server without any problem. You could try to enable the debug options on tedious side, which can provide more details on what causes that connection problem. There is how to enable the debug option from the connection configration:

var config = {
  server: '127.0.0.1',
  authentication: {
    type: 'default',
    options: {
      userName: 'sa',
      password: '123456'
    }
  }
  ,options: {
    port: 1433,
    database: 'test',
    tdsVersion:'7_1',
    // you do not have to enable all of this option, you can mix and match these options under debug
    debug: {
      packet: true,
      data: true,
      payload: true,
      token: true,
      log: true 
    },
  }
};

After you have added this, you also need to add an event listener to output the debug info:

connection.on('debug', function(text) {
  console.log(text);
});

With this, when you run your test script, the terminal will output the details from the debug trace. In this case, we can have more information related to this issue to work with.

Also, you can try to set the encrypt to false within the connection configuration. See if that helps.

var config = {
  server: '127.0.0.1',
  authentication: {
    type: 'default',
    options: {
      userName: 'sa',
      password: '123456'
    }
  }
  ,options: {
   // Set encrypt to false here
    encrypt: false,
    port: 1433,
    database: 'test',
    tdsVersion:'7_1',
    // you do not have to enable all of this option, you can mix and match these options under debug
    debug: {
      packet: true,
      data: true,
      payload: true,
      token: true,
      log: true 
    },
  }
};