Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

995 views
Skip to first unread message

kgingeri

unread,
Feb 16, 2009, 11:02:43 PM2/16/09
to Django users
I am fairly new to Django and am working my way through the latest
tutorial and get the error below. I have the latest dev for Django
installed (I know cuz I started out with 0.96), the most recent
FreeTDS, pyodbc and django-pyodbc. My isql and running all the api
stuff works fine with my SQL Server database but, when I try to use
the admin app I get the traceback below

Calling up http://localhost:8000/admin/ in my browser, yeilds...

Traceback (most recent call last):

...several lines here - I cut them for brevity...

ProgrammingError: ('42000', '[42000] [FreeTDS][SQL Server]Unicode data
in a Unicode-only collation or ntext data cannot be sent to clients
using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (4004)
(SQLExecDirectW)')

I reinstall several packages to be sure I have the latest, but still
no luck.
Any help is appreciated!

kgingeri

unread,
Feb 16, 2009, 11:27:38 PM2/16/09
to Django users
I should add a couple more things here that may have a bearing on my
problem...

a) I am running Ubuntu Linux and
b) I am accessing my data via a VPN connection
c) I have done most of my installs via Synaptics but will try to redo
some with compiling from source.

If I answer my own question, I will post back here.

Thx again for any ideas :v)

kgingeri

unread,
Feb 25, 2009, 4:19:29 PM2/25/09
to Django users
Ok, I figured this out myself...

I had to un-install all pre-installed odbc stuff - unixODBC (possibly
iODBC as well, except it didn't seem to actually uninstall completely)
and FreeTDS.

I then got source and did configure/make/make installs of unixODBC
first, then FreeTDS.
This order is important so that the ./configure command can find all
the right stuff.
An important note is the params for the FreeTDS ./configure command.
I used the following:

$ ./configure --with-unixodbc=/usr/local --enable-msdblib --disable-
libiconv --with-tdsver=8.0

Anyway, it's working now without complaint!

:v)



Mark Shewfelt

unread,
Mar 31, 2009, 11:25:55 AM3/31/09
to Django users
Hi Karl,

I just came across your post and am having the same issue (Ubuntu 8.04
Server). I managed to build the latest versions of unixODBC and
FreeTDS and install them to /usr/local/lib. When I run python and try
to import pyodbc I get the following error:

administrator@maverick:~/pyodbc-2.1.4$ python -c "import pyodbc"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: libodbc.so.1: cannot open shared object file: No such
file or directory
administrator@maverick:~/pyodbc-2.1.4$

So obviously pyodbc cannot find the libs I just built - but I cannot
figure out how to specify their location when building pyodbc. Did you
have this issue? Any help is welcome!

Thanks,

Mark

On Feb 25, 5:19 pm, kgingeri <kging...@gmail.com> wrote:
> Ok, I figured this out myself...
>
> I had to un-install all pre-installed odbc stuff - unixODBC (possibly
> iODBC as well, except it didn't seem to actually uninstall completely)
> andFreeTDS.
>
> I then got source and did configure/make/make installs of unixODBC
> first, thenFreeTDS.
> This order is important so that the ./configure command can find all
> the right stuff.
> An important note is the params for theFreeTDS./configure command.

Karl Gingerich

unread,
Mar 31, 2009, 8:41:58 PM3/31/09
to django...@googlegroups.com
Mark, I'll up to my eye balls in alligators right now, I'll get back to you soon. - Karl
-----Original Message-----
From: Mark Shewfelt <mshe...@gmail.com>

Date: Tue, 31 Mar 2009 08:25:55
To: Django users<django...@googlegroups.com>
Subject: Re: Incompatibility with FreeTDS/ODBC and Unicode on a MSSQL server?

Mark Shewfelt

unread,
Apr 1, 2009, 9:25:51 AM4/1/09
to Django users
Thanks Karl - Actually, this morning I gave up and upgraded Ubuntu to
8.10, which uses a newer version of FreeTDS and unixODBC. It seems to
work OK, though there are some funky Unicode issues using Django's
TextField, but I can get around those for now.

Cheers,

Mark
Reply all
Reply to author
Forward
0 new messages