DEV Community

Lam trien dong
Lam trien dong

Posted on

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
`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. (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
}
}

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More