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

barsalou barjunk at attglobal.net
Tue Oct 2 18:43:36 BST 2012


I just want to say thanks so much for posting your solution with links  
and other helpful information.

This is a good thing.

Mike B.

Quoting Theeravat Suensilpong <gdab.027 at gmail.com>:

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



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the unixODBC-support mailing list