What is required to connect to an external SQLSERVER database to my application?

Asked

Viewed 85 times

1

I have a hosting that I need to connect to a bank Sqlserver external in a php system I am creating. I insert all data correctly but always gives connection error showing the message:

mssql_connect(): Unable to connect to server:xxxxxxxxx

Is there some sort of incompatibility in my hosting for connections to the Microsoft bank? Need something else, a plugin or something like that? In Mysql it normally connects.

  • 1

    Is the server local? or cloud? if local, is the server installed on your machine? or on some server within the LAN network? if you are on your machine, are you using the right instance? example: 172.16.0.13 SQLEXPRESS? If it is in LAN have you checked if SQL is enabled to work in network? if it’s cloud-based, we usually have to release our IP to make the connection.

  • Hi Thomas. It’s not on my machine. The system is on one of our servers and the bank is on a client server. I haven’t checked if the IP is cleared yet, I’ll do it now. Thanks for the tip.

  • 1

    Matheus, check the port forwarding on your client, check the firewall rules by releasing by TCP 1433 (SQL Default Port)

  • 2

    Before trying to connect with your code, try using SQL Server Management Studio. If it fails, you may not be using the correct parameters or the connection to the bank may not be open.

  • Like this your connection string?

  • Marconcilio, the error appears at the beginning of the script. $host = 'http://www.endereco.ddns.net'; $user = 'user'; $pass= 'password'; mssql_connect($host, $user, $pass);

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.