我正在尝试使用sqlsrv_connect连接到MS SQL,在安装ODBC 11之前,我收到了安装ODBC 11所需的错误,因此我安装了它。我安装后,我再次收到另一条错误消息
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 22
[code] => 22
[2] => [Microsoft][ODBC Driver 11 for SQL Server]ODBC Driver 11 for SQL Server does not support connections to SQL Server 2000 or earlier versions.
[message] => [Microsoft][ODBC Driver 11 for SQL Server]ODBC Driver 11 for SQL Server does not support connections to SQL Server 2000 or earlier versions.
)
[1] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 22
[code] => 22
[2] => [Microsoft][ODBC Driver 11 for SQL Server]Client unable to establish connection
[message] => [Microsoft][ODBC Driver 11 for SQL Server]Client unable to establish connection
)
)
这可以连接这些连接吗?
function access_store($ips){
$conInfo = array("Database"=>"site5");
$conn = sqlsrv_connect($ips, $conInfo);
if($conn){
echo'Connection SUccess';
}else{
die('<pre>'.print_r( sqlsrv_errors(),true ).'</pre>');
}
}
答案 0 :(得分:0)
安装了什么版本的Microsoft PHP sql驱动程序?您需要较旧版本的驱动程序。
科技共和国有一篇好文章 Tech republic Microsoft SQL server driver