Sunday, January 30, 2011

Re: pyodbc: Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnectW)')

> conn = pyodbc.connect(r"DRIVER={FreeTDS};SERVER=testserver
> \mssql2008;DATABASE=eoffice;UID=erp;PWD=123")

Thanks for your reply, David!
You gave me great advice!
As you suggest, now I my connection is fine!
But there is one another problem occurred!
When I run the Select query, result is non unicode data while select
query reads nvarchar column from mssql database. My code is below:
import pyodbc
conn = pyodbc.connect(r'DRIVER={FreeTDS};SERVER=testserver
crms = conn.cursor()
crms.execute('SELECT cc_Name FROM tblHR_CodeClass')
for line in crms:
print 'cc_Name: %s' % (line.cc_Name)
Result is 'cc_Name: ?????, ???'. But I expected the result would be
'cc_Name: Aймаг, хот' because actual data is 'Aймаг, хот'.

Here is my question: Does the pyodbc library support Unicode?


You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment