Trying to write a simple program to parse Excel sheets then store the data in a Access database.
I'm not entirely sure what the issue is, I've tried renaming parameters, double checking spelling, etc.
cursor.execute('select * from MSDB')
cursor.execute('''
INSERT INTO MSDB ([SalesOrder], [SiteNumber], [SiteName], [Customer], [ShipDate])
VALUES(SO, SNM, Custom, SD, SN)
''')
conn.commit()
else:
continue
This gives me the error:
pyodbc.Error: ('07002', '[07002] [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 5. (-3010) (SQLExecDirectW)')
SO,SNMetc., they won't be evaluated by the SQL engine; or better yet, parameterise the query to avoid SQL injection. - Lee Mac