Search code examples
node.jssql-serverelectronmssql-jdbc

My Electron App is not connecting to server


I have my electron.exe file, and it's not being able to connect with my server. I work at a company that has this server, and with my computer, I can connect to it through the SSMS app, but when I try to connect with the Electron App, it says that it cannot connect to it...

I'm using the 'mssql'

I've set it free the port 1433, in the firewall as well. It's weird because in the SSMS app it connects easily, I use the connection like tcp:SERVER/DB,1433 (which is the port that I've set it free)...

That's my connection configuration

var dbConfig = {
            user: 'sa',
            password: '123456',
            server: 'SERVER\DB',
            port: '1433',
            trustServerCertificate: true,
            database: 'APPDATA',
            requestTimeout: 600000,
            options: {
                trustedConnection: true,
                useUTC: true
            },
            pool: {
                idleTimeoutMillis: 600000,
            }
        }

And I get the error

ConnectionError: Failed to connect to SERVER\DB in 15000ms

I hope you guys can help me out


Solution

  • It was a firewall problem, I just had to disable it and it worked perfectly, there was an conflict.