I've searched through about 50 posts that have the IM002 error and can't seem to figure out why I'm getting it. The full error is:
Traceback (most recent call last):
File "crc-upload-touchscreen-email-to-socketlabs.py", line 70, in <module>
"password =" + password + ";"
pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
I'm using an instance file to insert the relevant information.
here is what I have:
logger.info('Connect to database')
server = config.get('connection', 'server')
dbname = config.get('connection', 'dbname')
user = config.get('connection', 'username')
password = config.get('connection', 'password')
pyodbc.connect("DRIVER = {ODBC Driver 13 for SQL Server};"
"Server =" + server + ";"
"Database =" + dbname + ";"
"username =" + user + ";"
"password =" + password + ";"
"Trusted_Connection = yes;")