Orgil
unread,Jan 31, 2011, 7:42:21 AM1/31/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyodbc
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