I use the following code to connect to a MSSQL server and it works successfully
However this SQL server is now being decommissioned and I have to connect to a different MSSQL server.
The developers have given me a server name of "myserver1\instance1" but I am unable to connect via PHP.
When I put the new server name in Management Studio, I have no issue connecting.
Thanking in advance for any help received.
Code:
$myServer = "myserver";
$myUser = "user";
$myPass = "pass";
$myDB = "thedb";
//create an instance of the ADO connection object
$conn = new COM ("ADODB.Connection")
or die("Cannot start ADO");
//define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr); //Open the connection to the database
However this SQL server is now being decommissioned and I have to connect to a different MSSQL server.
The developers have given me a server name of "myserver1\instance1" but I am unable to connect via PHP.
When I put the new server name in Management Studio, I have no issue connecting.
Thanking in advance for any help received.