Monday, January 31, 2011

pyodbc & FreeTDS: Can I work with NVARCHAR column on MSSQL2008

Hello.
I have FreeTDS, pyodbc-2.1.8, python-2.6, ubuntu-10.4.
I also have MSSQL2008 database server on Windows7.

My question is: Can I get unicode data from nvarchar column on
Mssql2008 database using pyodbc?
To do this, what does other library or configuration need me?

I use FreeTDS driver to connect with mssql by pyodbc. But I don't know
version of FreeTDS.
How to know the version of FreeTDS?

My current state is, I can connect with mssql. But I can not get
unicode data!
My code is:
-----------------------
import pyodbc
conn =
pyodbc.connect(r'DRIVER={FreeTDS};SERVER=10.0.0.61\mssql2008;DATABASE=eoffice_clone;UID=erp;PWD=123;CHARSET=UCS-2;')
crms = conn.cursor()
crms.execute("SELECT cc_Name FROM tblHR_CodeClass")
for line in crms:
print 'cc_Name:', str(line.cc_Name)
conn.close()
-----------------------
Expected result is 'cc_Name: Аймаг, хот', but instead
'cc_Name: ?????, ???' comes.

Please, share your experience!

regards,
Orgil

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment