Page 1 of 1

Connect issues with MsSQL

PostPosted: 05. August 2013 08:03
by granson
Hi

New to using Xampp, but I have an issue connecting remotely from Xampp to a MsSQL database. I can connect to the database using visual studio on the same PC, just not through Xampp. I have added the extensions for php 5.4 and added the following to the php.ini file.

extension=php_pdo_sqlsrv_54_ts.dll
extension=php_sqlsrv_54_ts.dll

My php code to connect is

$serverName = "SERVERNAME3\INSTANCENAME"; //I have the correct servername and instance
$connectionInfo = array( "Database"=>"Test", "UID"=>"drupal", "PWD"=>"drupal");
$conn = sqlsrv_connect( $serverName, $connectionInfo);


if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}

and error i get is

Connection could not be established.
Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) )


any ideas would be greatly appreciated as I have spent the afternoon on this and got no where!

Re: Connect issues with MsSQL

PostPosted: 05. August 2013 22:22
by hackattack142
Hello,

Some extensions require external dependencies.

Did you install the Native Client at the link that it pointed you to?

Re: Connect issues with MsSQL

PostPosted: 15. October 2013 20:50
by richardv
I Have the same problem. Please who can help us?