Connect issues with MsSQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Connect issues with MsSQL

Postby granson » 05. August 2013 08:03

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!
granson
 
Posts: 1
Joined: 05. August 2013 07:49
XAMPP Version: 5.5.19
Operating System: Window 8

Re: Connect issues with MsSQL

Postby hackattack142 » 05. August 2013 22:22

Hello,

Some extensions require external dependencies.

Did you install the Native Client at the link that it pointed you to?
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
XAMPP Version: 5.6.3
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Connect issues with MsSQL

Postby richardv » 15. October 2013 20:50

I Have the same problem. Please who can help us?
richardv
 
Posts: 4
Joined: 10. October 2013 21:15
XAMPP Version: 5.5.19
Operating System: Windows server2003


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 47 guests