You can translate the question and the replies:

ODBC drives

Hi, I have two questions. When using ODBC in python :- 1. When there is a SQL error the Unicode driver we get this message (the ANSI drivers works fine) and not the underlying error - how do we avoid it : 'utf-8' codec can't decode byte 0x96 in position 3: invalid start byte connection string : connection = pyodbc.connect(r'DRIVER={DenodoODBC Unicode(x64)};SERVER=<ourip>;PORT=9996;DATABASE=<ourdb>;UID=<our uid>;PWD='+<our pwd>); 2. Are there any gotchas / differences in consuming data from ANSI driver vs Unicode driver?
user
21-02-2023 05:30:51 -0500
code

1 Answer

Hi, Regarding the error: `'utf-8' codec can't decode byte 0x96 in position 3: invalid start byte` Please refer to the previously answered community question [here](https://community.denodo.com/answers/question/details?questionId=906Du00000000OtIAI&title=Struggling+with+Python+Connection+--+Encoding+Issue). Denodo recommends always using the Denodo Unicode driver while using ODBC connection. You should refer to the [Access Through ODBC](https://community.denodo.com/docs/html/browse/latest/en/vdp/developer/access_through_odbc/access_through_odbc) section of the Virtual DataPort Developer Guide for more details about consuming data with the ODBC driver. The [ODBC Page](https://community.denodo.com/drivers/odbc/8.0) will provide the proper driver for your version of the Denodo Platform. However, I would recommend a JDBC connection from python to Denodo as JDBC tends to provide better performance. For more information, please follow the Knowledge Base article [How to connect to Denodo from Python - a starter for Data Scientists](https://community.denodo.com/kb/en/view/document/How%20to%20connect%20to%20Denodo%20from%20Python%20-%20a%20starter%20for%20Data%20Scientists). Hope this helps!
Denodo Team
21-02-2023 15:02:40 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here