![]() |
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (/showthread.php?tid=52650) |
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - El Forum - 06-20-2012 [eluser]Unknown[/eluser] Hi all. I am using CI 2.1.1 under Windows 2k3 IIS 6.0, PHP 5.2.1, SQL Server 10.50. Here is my connection string config: Code: $db['sqlserver']['hostname'] = 'Driver={SQL Server Native Client 10.0};Server=192.168.10.160;Database=<DB>;MultipleActiveResultSets=true;'; I am using this config locally (localhost) and it connects to the SQL Server successfully. When I deploy it to another test server, which is the 2K3 server I mentioned above, using the same connection config, I got this error: Code: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified This 2K3 server has ODBC enabled, I can see it in phpinfo(). In PHP.ini (2K3 server), I have this enabled: extension=php_pdo_odbc.dll If I login to 2k3 server and ping the SQL Server, it responses correctly. But I still cannot access the server, can anyone please give some advice on that? Thank you. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - El Forum - 06-20-2012 [eluser]Unknown[/eluser] I solve this problem myself. If I change 'hostname' from: Code: $db['sqlserver']['hostname'] = 'Driver={SQL Server Native Client 10.0};Server=192.168.10.160;Database=<DB>;MultipleActiveResultSets=true;'; to Code: $db['sqlserver']['hostname'] = 'Driver={SQL Server};Server=192.168.10.160;Database=<DB>;MultipleActiveResultSets=true;'; It works again. Very weird. For reference to those who are struggling in this problem. |