I am using Pyodbc and am trying to insert values into a Microsoft 2013 Access Database. However, everytime I run the code I get an error on the execute line:
pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. (-3502) (SQLExecDirectW)')
Does anyone have any ideas how to fix this? I have put my code below.
conn = pyodbc.connect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\\Database2.accdb;")
cur=conn.cursor()
sql="""INSERT INTO Invoices (LINE TYPE,INVOICE NUMBER) VALUES (?,?)"""
cur.execute(sql,("Line","41243"))