Gonkas
Gonkas

Reputation: 103

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.

Upvotes: 2

Views: 9968

Answers (1)

Gonkas
Gonkas

Reputation: 103

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

Upvotes: 4

Related Questions