Paul Hardy

Paul Hardy

  • NA
  • 3
  • 0

Selecting individual fields from an Excel spreadsheet through oledb

Aug 18 2008 10:16 AM

Hi All

I am currently attempting to read values from an excel spreadsheet to be manipulated in code and eventually stored in a db.  My current select statement reads SELECT * FROM [sheet1$] and works just fine, however, the application I am writing will be operating asyncronously and there may be many instances open at once, all reading different spreadsheets.  Because of this I am trying to limit my select statement in the event that somebody sends me 500 spreadsheets with 500 fields each when I only actually need 30 or so.  So, I am trying to be specific in my select statement thus SELECT name, address1, address2 from [sheet1$] but when I execute this command through oledb I am getting a No value given for one or more required parameters OleDbException.  If I replace my specified fields with * it works fine.  I know the fields I am requesting exist as I created the spreadsheet myself.  Does anybody have any ideas what might be going wrong?

TYIA

Paul


Answers (3)