Export data into an Excel file using OleDB

  • Thread starter Thread starter tommydnp
  • Start date Start date
T

tommydnp

Is there a possibility to insert values into excel using only an oledb
connection? It's no problem for me to select all data, but when I want
to insert data or create a table, there's a problem.

When I want to insert I always get: "Operation must use an updateable
query".
When I want to create a table I get a message that it's a read-only
database.

sql.CommandText = "insert into [Sheet1$] ([a], ) values('1', '2')"
sql.ExecuteNonQuery()

Connectionstring: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
fileName & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
 
Tommy,

AFAIK not, Excel does not follow the rules that OleDB needs to be updated by
that.

Cor
 
Back
Top