How to retrieve data from Excel with ADODB connection if the first line of the worksheet does not have the column name?

后端 未结 3 1076
野趣味
野趣味 2020-12-19 16:02

I use the following type of code to retrieve data from some Excel Workbooks (path is a Parameter)

Dim strSQL  As String, conStr as String
Dim cnn As New ADOD         


        
3条回答
  •  旧时难觅i
    2020-12-19 16:21

    You can query a range of cells starting from row 10:

     "SELECT * FROM [Worksheet$A10:S100] WHERE [Thing1] > 1"
    

    What can be tough is finding what the end of the range should be. You could put in a ridiculously large number, but then you'd have to add special handling for the rows of NULL at the end.

提交回复
热议问题