unixODBC woes

Leon Brooks leon at cclinic.com.au
Thu Sep 5 14:54:43 EDT 2002


Background: I'm researching the components needed to replace a small office's 
Windows workstations with thin (LTSP) clients. One requirement is that the 
installation be able to run MS-Access for a year or so, talking to MS SQl 
Server 7, while the application in question got a thorough Zopeing.

So far, we have MS-Access running under WINE (local MDBs only) and also 
(including network connections to MS SQL Server) under Win4Lin.

We would like to eliminate Win4Lin from the equation if possible because it 
carries more Windows along with it which represents a reliability risk, a 
security risk, and an expense.

With this in mind, I compiled unixODBC 2.2.2 on a Mandrake Linux 8.1 system, 
grabbed the EasySoft bridge software, plugged it all in, and got connectivity 
tests working through their web interface.

However, isql -v says that it can't find the DSN, and that there is no 
default. I tried all manner of DSNs both in odbc.ini and on isql's 
command-line. Without isql, I can't test actual SQL transactions. I strace 
-f'ed it to see what was going on. Boy, the squirrels are busy under the 
bark, there... I does read through /etc/odbc.ini (at least twice) so should 
be able to see the DSNs there.

Reading through the docs, I discovered a certain amount of MPD (Multiple 
Personality Disorder). Some of them insisted that odbc.ini's Driver= lines 
had to refer directly to a driver file, and others plonked for referring to 
an entry in odbcinst.ini; the actual working connection referred to the 
driver directly, but I tried the via-odbcinst path as well (all it did was 
cause the web interface based tests to start failing).

At this point, The Boss noticed that in order to do what he was expecting to 
do, EasySoft wanted about USD$4000 in licencing, an order of magnitude more 
than could be budgetarily justified now. So...

I grabbed, compiled and installed FreeTDS (0.53) with the --with-unixodbc 
option. It seemed happy to compile and install, but would not work with any 
of the configurations I could find or imagine. I presume that the 
[servername] entry in freetds.conf has to match the [DSNname] entry in 
odbc.ini, but the docs don't seem to define this anywhere. They (both 
unixODBC and FreeTDS) do speak of an interfaces file, which freetds.conf 
labels `obselete'.

I thought that perhaps freetds was broken, so I grabbed and compiled sqsh, 
telling it that SyBase lived at the --prefix I'd used for FreeTDS. I had to 
tweak the Makefile and config.h to get it compiled, but... one command and 
one password later, I was talking to the MS SQL Server through it.

At this point, I'd like to know (1) if there's some magic thing I need to do 
to make unixODBC's isql work; and (2) what I need to do to bolt FreeTDS into 
unixODBC and have it work.

WRT the latter, I note that some odbc.ini configs use Username=/Password= and 
others use UID=/PWD=; the working (through the EasySoft bridge) entry uses 
UserName=/Password=. I have an entry for TDS which is identical to the 
working one but for the driver name, and have also tried adding UID= and PWD= 
entries to no avail.

If I need to post debugging information, tell me what, how to get it if not 
obvious, and where to. I've fiddled with case dependency and all sorts of 
other stuff.

Cheers; Leon

-- 
Computer Clinic (WA) P/L     Lasting good health for your network!
+61-8-9207-3686              http://www.cclinic.com.au/

linux.conf.au 2003           The Australian Linux Technical Conference
http://conf.linux.org.au/    22-25 January 2003 in Perth, Western Australia




More information about the FreeTDS mailing list