Monday, October 26, 2015

php 5.4/5.6 MS SQL 2005/2008 - sqlstate im002 "microsoft odbc driver manager data source name not found"

Recently, I setup a new IIS on a windows 10 to connect a MS SQL server with PHP;  I got this Error Message, "sqlstate:  im002,  message: microsoft odbc driver manager data source name not found", when trying to connect to the server.

I tried to google the answer, but no one could solve my problem, most of the answers directed to the incorrectly version of ODBC driver. But it was not my case.

Eventually, I compared the new server configurations to my working one, and found that

"SQL Server Native Client 11.0" is installed.

so, I wrote this down and hope this helps someone.

p.s. if you've trouble to locate the download link of "SQL Server native Client"

take a look here: http://www.sqlservercentral.com/Forums/Topic1458276-2799-1.aspx


Updated on 20161217: Recently, I encountered the same problem with the environment like PHP 5.4 with SQL Server 2005 (SP4) and tried to move it to PHP 5.6.

I found no solution for this issue even updated the SQL Server native client from 11 to 12. I only can choose either to stay "PHP 5.4 with SQL Server 2005 (SP4)" or move to "SQL Server 2008 (and after)" if I want PHP 5.6.

2nd, since I've added a new feature to the current system that will work with AWS SMS, and PHP 5.5 is the minimum requirement for the AWS SDK.

Thus, in this case, I have to move the DB from 2005 to 2008 R2 and make it works with PHP 5.6.