odbc_connect sql server [英] odbc_connect sql server
问题描述
我正在尝试在Windows 2000 Server IIS上安装PHP5 Web服务器。
它可以运行php文件,但查询到我的SQL数据库会出错这是我的连接:
$ conn = odbc_connect(Driver = {SQL Server Native Client 10.0} ; Server = $ server; Database = $ database;,$ user,$ password);
在phpinfo中启用了obdc。
我的WapServer上的这个连接运行良好而没有错误。
数据库位于两台机器的本地服务器上。
如何解决这个问题?
谢谢。
经过一些尝试和错误我得到了答案,而不是 SQL Server Native Client 10.0 只是 SQL Server 。
以下是正确的连接代码:
$ conn = odbc_connect(Driver = {SQL Server}; Server = $ server; Database = $ database;,$ user,$ password);
I'm trying to install a PHP5 Web Server on Windows 2000 Server IIS.
It runs ok the php files but the query to my SQL database gives error without any kind of message.
This is my connection:
$conn=odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password);
In phpinfo the obdc is enabled.
This connection on my WapServer runs good without errors.
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.
Here is the correct connect code:
$conn=odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $password);
这篇关于odbc_connect sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!