Results 1 to 1 of 1

Thread: Connection fail to SQL Server using NodeJS mssql msnodesqlv8 from the server ?

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    522

    Connection fail to SQL Server using NodeJS mssql msnodesqlv8 from the server ?

    I use windows authentication but when the username didn't have permissions, I got a different error
    Code:
    var sql = require('mssql/msnodesqlv8');
    
    const config = {
        user: 'sa',
        password: 'Coffee',
        server: 'localhost', 
        database: 'Cafe', 
        driver: 'msnodesqlv8',
        port: 1433,
        options: {
          trustedConnection: true,
          enableArithAbort: true
        }    
      };
    
    const conn = new sql.ConnectionPool(config).connect().then(pool => {
        return pool;
      });
    When I connect to the internal server, I get an error:
    ConnectionError: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    at PrivateConnection.callback2 (D:\NodeJS\node_modules\mssql\lib\msnodesqlv8\connection-pool.js:46:17)
    at Immediate.<anonymous> (D:\NodeJS\node_modules\msnodesqlv8\lib\connection.js:41:14)
    at process.processImmediate (node:internal/timers:478:21) {
    code: undefined,
    originalError: [Error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified] {
    sqlstate: 'IM002',
    code: 0,
    severity: 0,
    serverName: '',
    procName: '',
    lineNumber: 0
    }
    }
    Last edited by dong; Mar 25th, 2024 at 11:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width