0
votes

I am running an application over IBM Bluemix and my backend database is SQL Server hosted on a remote server. I can easily connect with the SQL Server database using GUI tool, but when I try to connect and execute a query using the sql.js file, I am getting following error:

Query to execute:

SELECT * 
FROM SUBSCRIBER 
WHERE SUBSCRIBER_ID = 'abc'

Error:

ConnectionError: Login failed for user 'admin'.

My connection string:

msdb.connect("mssql://admin:root@[ip in actual code]/watch-me").then(function() {
.catch(function(err) {
        // ... query error checks 

        callBack(1,err,null,responseObj);
    });
}).catch(function(err) {
    console.log("error: " + err);
    // ... connect error checks 
    callBack(1, err, null, responseObj);
1
Is your database default or named instance? - Fka
i created a new with the name of watch-me, it's not the default one - vicky
Oh, excuse me - I meant server instance. Is it default or named? - Fka
i think it's default. didn't change anything. - vicky
Is your database server accessible from Bluemix or is it behind a firewall? - data_henrik

1 Answers

0
votes

In my connection String, database name was not correct, fixed it and it's working now.