简体   繁体   English

odbc_connect sql服务器

[英]odbc_connect sql server

I'm trying to install a PHP5 Web Server on Windows 2000 Server IIS. 我正在尝试在Windows 2000 Server IIS上安装PHP5 Web服务器。

It runs ok the php files but the query to my SQL database gives error without any kind of message. 它可以正常运行php文件,但对我的SQL数据库的查询给出了错误,没有任何消息。

This is my connection: $conn=odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password); 这是我的连接: $conn=odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password);

In phpinfo the obdc is enabled. 在phpinfo中,obdc已启用。

This connection on my WapServer runs good without errors. 我的WapServer上的此连接运行良好,没有错误。

The database is on a local server for both machines. 该数据库位于两台计算机的本地服务器上。

How can I resolve this? 我该如何解决?

Thanks. 谢谢。

After some try and error I achieved an answer, instead of SQL Server Native Client 10.0 is just SQL Server . 经过一番尝试和错误后,我获得了答案,而不是SQL Server Native Client 10.0仅仅是SQL Server

Here is the correct connect code: 这是正确的连接代码:

$conn=odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $password);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM