Process finished with exit code -1073741819 (0xC0000005) in PyCharm, RESTART: Shell in IDLE, and closes console

1

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

python
python-3.x
odbc
pyodbc
ctree
asked on Stack Overflow Nov 26, 2018 by jacobJACOBjacob

1 Answer

0

you should change the field in the connection string where is for the specific value of your application.

For example here, instead of < Host from driver config >. Lets say your host is MYHOST. You should put MYHOST. Same thing for < User name >, you should put your username, like jacob, and so on. Normally these field with brackets are the on you have put a value:

# Connection string from Query Tool. Added driver parameter
conn = pyodbc.connect('ODBC;DSN=DOTLIVEREP;Host=MYHOST;UID=jacob;PWD=<Password>;DATABASE=liveSQL;SERVICE=6597 ;CHARSET NAME=;MAXROWS=;OPTIONS=;;PRSRVCUR=OFF;;FILEDSN=;SAVEFILE=;FETCH_SIZE=;QUERY_TIMEOUT=;SCROLLCUR=OFF;')
answered on Stack Overflow Feb 11, 2021 by Guilherme Kich

User contributions licensed under CC BY-SA 3.0