Excel - insert into - execute non query database

Hi- I am exploring DataBase options and need guidance to insert data into excel sheet (execute non query)

Connection tested and working when displayed no. of rows

Attaching images of error

Thanks
Greeshma

Execute_Non qry1 Execute_Non qry2

Hi @gsripada
can you try it using it insert query within for each loop

Thanks
Ashwin S

1 Like

Can you show the connection string you pass ?

i think you are missing the column names there… like this:
INSERT INTO [Sheet1$] (Username, Password) VALUES ('Leaptest', 'Password')

connection string1 connection string2

excel file

Attaching:

  1. Excel file where I want to insert data
  2. Connection String
    3.Selection of excel file to build connection string

Thanks for the help

SQL DataBase Academy.zip (14.2 KB)

ExcelAsDatabase_Example.zip (18.3 KB)

Refer to the above example. Also, this page was a big help.

Thank you for your help.

I also figured that while building connection and after selecting excel file, there is an option as Read Only if you uncheck that the execute non query will work.

Regards,
Greeshma

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.