问题是当我运行这个PHP代码时:
if (function_exists('sqlsrv_connect')) {
echo "Connection functions are available.\n";
} else {
echo "Connection functions are not available.<br />\n";
}
$serverName = "TEST-DESKTOP\SQLEXPRESS";
$connectionInfo = array( "Database"=>"DALEDB");
// connection to the database
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Could not connect.<br />";
die( print_r( sqlsrv_errors(), true));
}
我的输出是:
Connection functions are available
Could not connect
Array
(
[0] => Array
(
[0] => IMSSP
[SQLSTATE] => IMSSP
[1] => -49
[code] => -49
[2] => This extension requires the Microsoft SQL Server 2011 Native Client. Access the following URL to download the Microsoft SQL Server 2011 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712
[message] => This extension requires the Microsoft SQL Server 2011 Native Client. Access the following URL to download the Microsoft SQL Server 2011 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
)
)
我已经拥有了2008 r2原生客户端,但我安装了2011客户端却没有成功,并且在过去的两天里一直停留在这一点上。如果有人能给我一些指示,我将不胜感激。