OLEDB query on Excel without headers: How do I specify Columns?

前端 未结 2 817
挽巷
挽巷 2021-01-16 14:42

I need to be able to handle Excel files versions 97 - 2010 and also those with and without header info.

Don\'t need help with connection strings : that works.

<
2条回答
  •  温柔的废话
    2021-01-16 15:09

    This post put me onto the answer, Thanks! Just a minor clarification that kept me guessing for a while: In the above SELECT * FROM [Sheet1$G4:Z12] note that it is the sheet name not the number that goes into the part "Sheet1" E.g. "Changes", the $ that follows it vital and then no other $'s as might be used for excel ranges. In my case the full string reads: SELECT * from [Changes$A3:Z13]

提交回复
热议问题