Unable to connect to an external database

Unable to connect to an external database

  

I want to connect my app to an existing external database. I have created a Database Connection on Service Center, but when I test the connection, I get the following error:

"Connection String test failed: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)."

The port seems to be open when I run Command Prompt. Also, the server is shown to be running on the Configuration Manager.

What could be causing this error?

Thanks.

Hi jamee,

WHERE is the external database sql server?
It must be in a public IP, as the Service Center is in the server and the connection will be made from the server.
So, anything that prevents the communications, from the side of the OutSystems server or the external database server, will prevent the connection to work.

For example, if your external database is in your computer, unless your computer has a public IP, the OutSystems server will bot be able to communicate with it.

How is your configuration?

Cheers.

Hi,

How do I check if it's in a public IP? The SQL Server Management Studio is a local setup on my computer. 

I'm not sure what you mean by the configuration.

Thanks.

Hello jamee.

Unless your computer have a static IP (not usual for personal computers), it will be difficulty for you to be able to USE your server.

How did you configured the connection in Service Center? What did you put in the Server field?
Usually is an IP. You will have to discover your computer external IP so that the server can reach your computer (if you used localhost or 127.0.0.1 in Service center, you're saying that the external db is in the OutSystems server).

The problem is that probably your IP will change between connections. So, even if you give the correct IP, if your connection goes down, when it goes up again, the IP can change and than the connection will fail (there is a way to solve this with public dynamic DNS services, i think).

So, why are you trying to connect to an external database in your personal computer? Usually they are in the cloud... (or local servers with static IP or in the same infrastructure than the OutSystems Server).

Cheers.

Hi,

For the Server field, I put the SQL Server Management Studio Server Name, instead of an IP. 

I'm trying to connect to an external database because I want to show a different data set than what is already configured on the template application. There's a few extra fields I wanted to show on my application.

Thanks.

Hi jamee,

Cant you change your application database in the server?

In any case, you will have to put an URL that is accessible. So, an IP or the name of the machine (like a web address).

Otherwise, the application, that is in the OutSystems Server, in the cloud (if you're using a personal environment), will not be able to reach your sql database server, because it will think it is in the same machine (but they don't).

Cheers.

Hi,

How would I change it in the server?

I've tried putting in the IP Address of my computer, but I still get the same error (I've used the local and external ones).

Thanks.