[unixODBC-support] unixODBC: isql configuration error

Stefan Radman Stefan.Radman at CTBTO.ORG
Tue May 9 11:23:16 BST 2006


> USER DATA SOURCES..: /usr/local/lib/libodbc.so
Something is really is messed up. This usually reads:
  USER DATA SOURCES..: $HOME/.odbc.ini

You seem to have set the ODBCINI environment variable to point to a
shared library!
Sort this out first (unset ODBCINI) and verify with odbcinst -j.

Here is how your config files should look like for a odbc-only
configuration:

/usr/local/etc/odbcinst.ini
[FreeTDS]
Description     = v0.63
Driver          = /usr/local/lib/libtdsodbc.so
UsageCount      = 1
 
/usr/loca/etc/odbc.ini (or $HOME/odbc.ini)
[re_data_warehouse]
Driver          = FreeTDS
Description     = MS SQLServer
Server          = re-navi-test.fakedomainname
Port            = 1433
TDS_Version     = 8.0
Database        = re_data_warehouse

This should at least get isql to work.
Whatever you keep in freetds.conf, in this configuration it will only
apply to tsql.
If you only intend to use isql and ODBC you can get rid of freetds.conf
to simplify matters.

> I get the isql errors regardless of if  Driver is set to 
> /usr/local/lib/libtdsodbc.so (as installed) or set to 
> /usr/local/lib/libodbc.so.
libodbc.so is the unixODBC driver manager itself, not the database
driver.
It provides the ODBC interface to the application, not the native
interface to the database.
See http://www.unixodbc.org/internals.html
> get library errors when using libtdsodbc.so.   I suspect that 
Naturally. Same story. It's the wrong interface.

I have never worked with Oracle database links via ODBC but according to
the documentation the init.ora should contain (in your case):
HS_FDS_SHAREABLE_NAME = /usr/local/lib/libodbc.so
HS_FDS_CONNECT_INFO = re_data_warehouse

The first one shows points Oracle to the unixODBC driver manager, the
second one points it to your datasource.

Hope that helps
Good luck
Stefan

> -----Original Message-----
> From: unixodbc-support-bounces at easysoft.com 
> [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Gau, Terry
> Sent: Monday, 08 May, 2006 17:23
> To: unixodbc-support at easysoft.com
> Subject: [unixODBC-support] unixODBC: isql configuration error
> 
> Hi,
> I am new to FreeTDS and unixODBC, so please excuse my likely 
> naive posting.  I find lots of similar postings on google, 
> but can't seem to find the solution for me.
> My ultimate goal is to connect to SQLServer  from Oracle 
> using Generic Connectivity.  
> 
> Facts:
> ------------------------
> Solaris 5.8
> freetds-0.63
> unixODBC-2.2.11
> Oracle 8.1.7.4
> SQLServer 2000 (domain login) (located in Europe)
> 
> Configuration Files:
> ---------------------------
> $ odbcinst -j
> unixODBC 2.2.11
> DRIVERS............: /usr/local/etc/odbcinst.ini
> SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
> USER DATA SOURCES..: /usr/local/lib/libodbc.so
> 
> $ cat odbcinst.ini
> [FreeTDS]
> Description             = v0.63 with protocol v8.0
> Driver          = /usr/local/lib/libodbc.so
> UsageCount              = 1
> 
> [ODBC]
> Tracefile = /tmp/odbc.log
> Trace = Yes
> 
> This freetds.conf file has been cleaned up considerable in an 
> attempt to simplify things for me.
> $ cat freetds.conf
> [global]
>         # TDS protocol version
>         tds version = 8.0
> 
> [re_data_warehouse]
> host          = re-navi-test.fakedomainname
> database        = re_data_warehouse
> port            = 1433
> 
> $ cat .odbc.ini
> [ODBC Data Sources]
> FreeTDS
> ODBC
> re_data_warehouse
> 
> [FreeTDS]
> Description             = v0.63 with protocol v8.0
> Driver          = /usr/local/lib/libodbc.so
> UsageCount              = 1
> 
> [ODBC]
> Tracefile               = /tmp/odbc.log
> Trace           = Yes
> 
> [re_data_warehouse]
> Description     = MS SQLServer
> Server          = re-navi-test.fakedomainname
> Database        = re_data_warehouse
> Port            = 1433
> TDS_Version     = 8.0
> 
> Behavior:
> ----------------------------------
> I am able to connect to SQLServer and run sql queries using 
> both methods of tsql (-H and -S).  
> 
> isql fails with...
> $ isql -v re_data_warehouse
> [IM002][unixODBC][Driver Manager]Data source name not found, 
> and no default driver specified
> [ISQL]ERROR: Could not SQLConnect
> 
> I get the isql errors regardless of if  Driver is set to 
> /usr/local/lib/libtdsodbc.so (as installed) or set to 
> /usr/local/lib/libodbc.so.
> 
> I now get the same messages when attempting to connect from 
> Oracle through a database link after changing init.ora 
> variable HS_FDS_SHAREABLE_NAME from 
> /usr/local/lib/libtdsodbc.so to /usr/local/lib/libodbc.so.  I 
> get library errors when using libtdsodbc.so.   I suspect that 
> once I fix isql, Oracle Generic Connectivity should work.
> 
> ODBC Trace Output:
> ------------------------------
> $ cat odbc.log
> [ODBC][28232][__handles.c][444]
>                 Exit:[SQL_SUCCESS]
>                         Environment = 1dc8d0
> [ODBC][28232][SQLAllocHandle.c][345]
>                 Entry:
>                         Handle Type = 2
>                         Input Handle = 1dc8d0
> [ODBC][28232][SQLAllocHandle.c][463]
>                 Exit:[SQL_SUCCESS]
>                         Output Handle = 1dce68
> [ODBC][28232][SQLDriverConnect.c][678]
>                 Entry:
>                         Connection = 1dce68
>                         Window Hdl = 0
>                         Str In = 
> [DSN=re_data_warehouse;UID=FAKEDOMAIN\bcamgr;PWD=*********][le
> ngth = 51 (SQL_NTS)]
>                         Str Out = ffbed7bc
>                         Str Out Max = 1020
>                         Str Out Ptr = ffbed7ba
>                         Completion = 0
> [ODBC][28232][SQLDriverConnect.c][1085]Error: IM002
> [ODBC][28232][SQLError.c][424]
>                 Entry:
>                         Connection = 1dce68
>                         SQLState = ffbed72c
>                         Native = ffbed120
>                         Message Text = ffbed528
>                         Buffer Length = 511
>                         Text Len Ptr = ffbed526
> [ODBC][28232][SQLError.c][461]
>                 Exit:[SQL_SUCCESS]
>                         SQLState = IM002
>                         Native = ffbed120 -> 0
>                         Message Text = [[unixODBC][Driver 
> Manager]Data source name not found, and no default driver specified]
> 
> Naive Summary:
> ------------------------
> It looks to me like the driver/library file isn't looking for 
> odbc.ini or freetds.ini files.  My intention is to use the 
> ODBC only configuration, but I honestly can't determine how 
> to force that.
> 
> TIA for any and all feedback.
> 
> Terry
> 
> 
> --------------------
> 
> This email message is for the sole use of the intended 
> recipient(s) and
> may contain privileged information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and 
> destroy all copies
> of the original message.
> 
> 
> 
> _______________________________________________
> 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