I am trying to use the update statement, but my database won't accept (int, ) only int.
import pyodbc
connect_data = (
r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};
r'DBQ=C:\filename.accdb;'
)
cnxn = pyodbc.connect(connect_data)
crsr = cnxn.cursor()
crsr.execute('select ID from WeatherAnalisis')
weathertable = crsr.fetchmany(5)
for rowcount in weathertable:
timeCET = timeCET + timeincrement
print (rowcount)
sql = "UPDATE WeatherAnalisis SET Time_UTC = ? WHERE ID = ?"
crsr.execute(sql, timeCET, rowcount)
cnxn.commit()
>>>>
(1, )
crsr.execute(sql, timeCET, rowcount)
pyodbc.Error: ('HY004', '[HY004] [Microsoft][ODBC Microsoft Access Driver]Invalid SQL data type (67) (SQLBindParameter)')
This seems to be because the rowcount is in the (int, ) format instead of int
now my question is: How do I get it to give me just the interger?