[unixODBC-support] [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect

Theeravat Suensilpong gdab.027 at gmail.com
Tue Oct 2 04:01:04 BST 2012


I cannot connect MS SQL Server through PHP+unixODBC+FreeTDS.
I have test the connection both tsql and isql, both are successful.

{odbcinst.ini}
[FreeTDS]
Description=v0.91 with protocol v8.0
Driver=/usr/local/lib/libtdsodbc.so
UsageCount=1

{odbc.ini}
[SQLServer]
Driver=FreeTDS
Description=SQL
Trace=No
Server=192.168.xx.xx
Port=1433
TDS_Version=7.0
Database=DB_Name

{test.php}
<?php
$connection_id = odbc_connect("SQLServer","username","password");
echo "ConnectID: $connection_id<br/>";
?>

{ERROR MSG}
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source
name not found, and no default driver specified, SQL state IM002 in
SQLConnect in /var/www/test_mssql/test.php on line 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20121002/45f8fb01/attachment.html>


More information about the unixODBC-support mailing list