I'm trying to connect c-TreeSQL using Python. I know I have the correct driver because I can connect using George Poulose's Query Tool
I have tried these variations and each one has crashed;
import pyodbc
## Instructions from http://doc.4d.com/4Dv17/4D/17/Using-a-connection-string.200-3786162.en.html
# conn = pyodbc.connect('Driver={c-treeACE ODBC Driver};Host=<Host from driver config>;UID=<User name>;PWD=<Password>;DATABASE=liveSQL;')
# Connection string from Query Tool
# conn = pyodbc.connect('Driver={c-treeACE ODBC Driver};ODBC;DSN=DOTLIVEREP;Host=<Host from driver config>;UID=<User name>;PWD=<Password>;DATABASE=liveSQL;SERVICE=6597 ;CHARSET NAME=;MAXROWS=;OPTIONS=;;PRSRVCUR=OFF;;FILEDSN=;SAVEFILE=;FETCH_SIZE=;QUERY_TIMEOUT=;SCROLLCUR=OFF;')
# Connection string from Query Tool. Added driver parameter
conn = pyodbc.connect('ODBC;DSN=DOTLIVEREP;Host=<Host from driver config>;UID=<User name>;PWD=<Password>;DATABASE=liveSQL;SERVICE=6597 ;CHARSET NAME=;MAXROWS=;OPTIONS=;;PRSRVCUR=OFF;;FILEDSN=;SAVEFILE=;FETCH_SIZE=;QUERY_TIMEOUT=;SCROLLCUR=OFF;')
print('Success')
Each one of these connection strings causes a crash in PyCharm, IDLE, and the console.
I'm not sure what would be causing this
To anyone who has been smashing their head against the wall for hours on this one, just use the ODBC library instead of the PyODBC library: once you use ODBC.odbc() to connect with the exact same connection string, everything works.
I have no idea what it is with the c-tree driver VS PyODBC library (my client used Attache and it was using a variation of the c-tree driver to connect, the driver is 32 bit but not sure if that's part of the issue since I also use 32 bit Python), it just makes the Python.exe crash as soon as it connects in my case.