简体   繁体   中英

odbc_connect sql server

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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