[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 17:54:02 BST 2012


I googled the issue and found "strace  2>traces.log /usr/local/zend/bin/php
/var/www/html/index.php" from
http://forums.zend.com/viewtopic.php?f=8&t=55838

I try the suggestion on the forum, but failed.
In traces.log

> 678 open("/usr/local/etc/odbcinst.ini/odbcinst.ini", O_RDONLY) = -1
> ENOTDIR     (Not a directory)
> 679 open("/usr/local/etc/odbcinst.ini/odbcinst.ini",
> O_WRONLY|O_CREAT|O_TRU    NC, 0666) = -1 ENOTDIR (Not a directory)
> 680 access("/usr/local/etc/odbcinst.ini/odbc.ini", F_OK) = -1 ENOTDIR (Not
>     a directory)
> 681 time(NULL)                              = 1349196712
> 682 open("/usr/local/etc/odbcinst.ini/odbcinst.ini", O_RDONLY) = -1
> ENOTDIR     (Not a directory)
> 683 open("/usr/local/etc/odbcinst.ini/odbcinst.ini",
> O_WRONLY|O_CREAT|O_TRU    NC, 0666) = -1 ENOTDIR (Not a directory)


So I edit  *putenv("ODBCSYSINI=/usr/local/etc/odbcinst.ini");* to *
putenv("ODBCSYSINI=/usr/local/etc");*
*
*
Now it works!!




On Tue, Oct 2, 2012 at 3:45 PM, Theeravat Suensilpong <gdab.027 at gmail.com>wrote:

> How can I check the error?
>
>
> On Tue, Oct 2, 2012 at 1:55 PM, Nick Gorham <nick at lurcher.org> wrote:
>
>> On 02/10/12 04:01, Theeravat Suensilpong wrote:
>>
>>> I cannot connect MS SQL Server through PHP+unixODBC+FreeTDS.
>>> I have test the connection both tsql and isql, both are successful.
>>>
>>
>> PHP is probably not finding the ini files, or if it is its failing to
>> find the driver files.
>>
>> --
>> Nick
>> ______________________________**_________________
>> unixODBC-support mailing list
>> unixODBC-support at mailman.**unixodbc.org<unixODBC-support at mailman.unixodbc.org>
>> http://mailman.unixodbc.org/**mailman/listinfo/unixodbc-**support<http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20121002/82c268d7/attachment.html>


More information about the unixODBC-support mailing list