something within following lines:
https://github.com/mkleehammer/pyodbc/wiki
at least for Connection and Cursor objects.
Check also the connection string depending on your database
def updateSent(msg_id): with pyodbc.connect('UID='+dbUser+';PWD='+dbPassword+';DSN='+dbHost) as cnxn: # I assume user, password and host will have fixed, real values cursor = cnxn.cursor() update_stmt = "UPDATE WKM_sms_outbound SET status='sent' WHERE msg_id=?" row_count = cursor.execute(update_stmt, msg_id).rowcount cnxn.close() return row_count # this way your function will return number of affected rowstake a close look at pyodbc docs:
https://github.com/mkleehammer/pyodbc/wiki
at least for Connection and Cursor objects.
Check also the connection string depending on your database
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs