Export data into an Excel file using OleDB

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tommydnp

    #1

    Export data into an Excel file using OleDB

    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], [b]) values('1', '2')"
    sql.ExecuteNonQ uery()

    Connectionstrin g: "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
    fileName & ";Extended Properties=""Ex cel 8.0;HDR=Yes;IME X=1"""
  • Cor Ligthert[MVP]

    #2
    Re: Export data into an Excel file using OleDB

    Tommy,

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

    Cor

    Comment

    Working...