[unixODBC-support] odbc.ini question

Martin J. Evans martin.evans at easysoft.com
Thu Aug 25 16:40:58 BST 2005


On 25-Aug-2005 Daniel Corbe wrote:
> So why doesn't my setup work?  What am I doing wrong?

Because it looks like you are using an iODBC-like structure to the odbc.ini
file. unixODBC uses:

odbcinst.ini to define drivers
odbc.ini to define dsns

So you might have something like:

odbcinst.ini
============

[ODBC]
TraceFile               = /tmp/sql.log
Trace           = No

[OOB]
Description             = Easysoft ODBC-ODBC Bridge
Driver          = /usr/local/easysoft/oob/client/libesoobclient.so.1
Setup           = /usr/local/easysoft/oob/client/libesoobsetup.so.1
UsageCount              = 1


odbc.ini
========

[sqlserver]
driver          = oob
port            = 8888
server          = elde
logonuser               = user
LogonAuth               = xxxxxxxxxx
Targetdsn               = sqlserver
transport               = tcpip
TargetUser              = Administrator
TargetAuth              = yyyyyyyy


Note, the driver= in the odbc.ini must be the name of the driver in the [] in
the odbcinst.ini.

Look at examples on the unixODBC web pages.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

> snmp01# odbcinst -j
> unixODBC 2.2.11
> DRIVERS............: /usr/local/etc/odbcinst.ini
> SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
> USER DATA SOURCES..: /root/.odbc.ini
> 
> All odbc/odbcinst files are exactly the same.
> 
> On 8/25/05, Martin J. Evans <martin.evans at easysoft.com> wrote:
>> Run odbcinst -j and it tells you:
>> 
>> /usr/local/easysoft/unixODBC//bin/odbcinst -j
>> unixODBC 2.2.12
>> DRIVERS............: /etc/odbcinst.ini
>> SYSTEM DATA SOURCES: /etc/odbc.ini
>> USER DATA SOURCES..: /home/martin/.odbc.ini
>> 
>> Martin
>> --
>> Martin J. Evans
>> Easysoft Ltd, UK
>> Development
>> 
>> 
>> On 25-Aug-2005 Daniel Corbe wrote:
>> > I recently installed UnxODBC out of freebsd ports and I have a question
>> >
>> > Where the bloody hell am I suppoed to put the odbc.ini file?  I have
>> > it in several obvious locations but it doesn't seem to work!
>> >
>> > snmp01# isql -v PRODSQLCLUSTERdsn dcorbe XXXXXXXX
>> > [IM002][unixODBC][Driver Manager]Data source name not found, and no
>> > default driver specified
>> > [ISQL]ERROR: Could not SQLConnect
>> >
>> > This is my odbc.ini file locate in:
>> > /etc/odbc.ini
>> > /usr/local/etc/odbc.ini
>> > /usr/local/etc/ODBCDataSource/odbc.ini
>> > /usr/local/spool/sql/ini/odbc.ini
>> > ~/.odbc.ini
>> >
>> > snmp01# cat /etc/odbc.ini
>> > [ODBC Data Sources]
>> >  PRODSQLCLUSTERdsn = Microsoft SQL Server ODBC DSN
>> >
>> > [PRODSQLCLUSTERdsn]
>> >  Driver          = /usr/local/freetds/lib/libtdsodbc.so
>> >  Description     = Microsoft SQL Server ODBC DSN
>> >  Trace           = No
>> >  Servername      = PRODSQLCLUSTER
>> >  Database        = NOC_Monitor
>> >
>> > [Default]
>> >  Driver          = /usr/local/freetds/lib/libtdsodbc.so
>> >
>> > What am I doing wrong?
>> >
>> > _______________________________________________
>> > unixODBC-support mailing list
>> > unixODBC-support at easysoft.com
>> > http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>> _______________________________________________
>> unixODBC-support mailing list
>> unixODBC-support at easysoft.com
>> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>>
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support



More information about the unixODBC-support mailing list