Re: FreeTDS on Debian: connect to MSSQL with ODBC fails

"Boniforti Flavio" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hello again Peter...

> > Where may the problem be?
> 
> I'm making some suggestions here without knowing enough about 
> your environment.  Please take this with a grain of salt, 
> unixODBC does a lot of dynamic linking/loading magic to allow 
> for multiple library providers, etc.

I actually don't know what you're talking about, because it goes well
further than my knowledge about ODBC (in fact, I simply know that I may
use ODBC to connect to some db, nothing more).

> That said, installing your odbc library into /usr/lib/odbc is 
> probably putting it outside the normal search path of the 
> dynamic linker.  For the sake of testing, can you try running:
> 
> env LD_LIBRARY_PATH=/usr/lib/odbc osql -S sqlexpress -U sa -P XXXXXX

Here we go:

root@ticket:~# env LD_LIBRARY_PATH=/usr/lib/odbc osql -S sqlexpress -U
sa -P XXXXXX
osql: error: no potential directory strings in "/usr/bin/isql"
isql strings are:
+ /lib/ld-linux.so.2

> though it looks like osql is using strings on the isql binary 
> instead of something more sensbile like ldd, objdump -x, etc. 
>  So this could get more complex.
> 
> However, in practice using that should allow isql to find the library.
> If not, then you need to muck around with building with 
> linker flags like -Wl,-R/usr/lib/odbc when you link your isql 
> so that osql can find it, or setting your LD_LIBRARY_PATH and 
> LD_RUN_PATH so that ld uses the run path when linking, and so 
> the paths get saved in the binary.
> 
> BTW, did you build your freetds with the 
> --with-unixodbc=/usr/lib/odbc or something similar to enable it?

Peter, I did not compile anything on my Debian server: I simply
installed via apt the relevant pieces of software.

ii  freetds-bin                        0.82-7
FreeTDS command-line utilities
ii  freetds-common                     0.82-7
configuration files for FreeTDS SQL client libraries

Where may I get help on this issue? It's really frustrating, having set
up OTRS but not being able to use the data I already have in my MSSQL db
(which stores our company db, with customer data).

Kind regards,
Flavio Boniforti

PIRAMIDE INFORMATICA SAGL
Via Ballerini 21
6600 Locarno
Switzerland
Phone: +41 91 751 68 81
Fax: +41 91 751 69 14
URL: http://www.piramide.ch
E-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.