I am unable to write this df into the access table. What am I not doing right?
conn_str = (
r'DRIVER={Microsoft Access Driver (*.mdb)};'
r'DBQ=C:\Users\harsh\Desktop\Database1.mdb;'
)
cnxn = pyodbc.connect(conn_str)
SQL = 'SELECT * FROM Index_data;'
dfins = pd.read_sql(SQL, cnxn)
for index, row in dfins.iterrows():
with cnxn.cursor() as crsr:
crsr.execute('select * from df')
conn.commit()
