Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Oledb Dataprovider - Reported Error

Oledb Dataprovider - Reported Error

Scheduled Pinned Locked Moved Visual Basic
databasehelptestingbeta-testing
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samsonx
    wrote on last edited by
    #1

    Hi, Whenever am trying to run the following query insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\Documents and Settings\sbritto\Desktop\testing.xls;','SELECT * FROM [Sheet1$]') select * from sqlserver am getting an "Reported error". Here am trying to export the data from sqlserver to an existing excel. What's wrong in this Query. Please help me out Thanks in Advance

    Regards, Samson

    D 1 Reply Last reply
    0
    • S samsonx

      Hi, Whenever am trying to run the following query insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\Documents and Settings\sbritto\Desktop\testing.xls;','SELECT * FROM [Sheet1$]') select * from sqlserver am getting an "Reported error". Here am trying to export the data from sqlserver to an existing excel. What's wrong in this Query. Please help me out Thanks in Advance

      Regards, Samson

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You didn't specify any column names. The format for an SQL INSERT statement is:

      INSERT INTO table (column1, column2, ...)
      VALUES (value1, value2, ...)

      Also, it would appear that you need to get a recordset from the Excel sheet, append the SQL Server rows to it, then write the recordset back to the Excel sheet. This would be 3 operations instead of just the one.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups