Hi,
After some frenzied trying with codecs and views, I finally got it to work.
It's a ugly hack, but works "for the moment"
In dal.py I added: (TDS_VERSION=8.0)
cnxn = 'SERVER=%s;PORT=%s;DATABASE=%s;UID=%s;PWD=%s*;TDS_VERSION=8.0*;%s' \
% (host, port, db, user, password, urlargs)
I could not make it work with url name-values in the connection string like
?DRIVER={FreeTDS};TDS_VERSION=8.0..
I guess that there is some config error by me in the FreeTDS config, or
that there are some interesting stuff going on in the remote mssql database
settings.
Beq, I need to do the connection with db_codec='latin1' to not get the
'exceptions.UnicodeDecodeError'> 'utf8' codec can't decode byte 0xe4...
So, this is sorta solved with duct tape and good intentions :)
--
Regards Falk
On Friday, February 14, 2014 12:14:30 PM UTC+1, Falk wrote:
>
> Hi,
>
> I am for the first time messing with mssql dal adapter and are really
> struggling to get it working to a SQL2008 server..
>
> I have gotten the connection with FreeTDS working
>
> When I connect in python with.
> >>> conn = pyodbc.connect ('DSN=TS;UID=foo;PWD=bar')
> >>> cursor = conn.cursor()
> >>> cursor.execute("select * from INVENT where ID=3000")
> <pyodbc.Cursor object at 0x14591b0>
> >>> for row in cursor:
> ... print row
>
> Everything works..
>
> But when connecting with dal:
> db = DAL('mssql://foo:bar@host/db?DRIVER={FreeTDS}',
> migrate_enabled=False)
> I get the..
> <class 'pyodbc.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 tried to send ?DRIVER={FreeTDS}&TDS_VERSION=8.0 with no result..
>
> And I cannot do a DSN connection with DAL:
> db = DAL('mssql://DSN=TS;UID=foo;PWD=bar', migrate_enabled=False)
>
> Any ideas?
> Sorry if this has been up before and I missed totally..
>
> But I am really stuck here :)
>
> --
> Regards Falk
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.