OLEDB Connection to support more than 65536 rows (Update Access from Excel Sheet)

后端 未结 1 685
独厮守ぢ
独厮守ぢ 2021-01-22 15:59

I can use the following SQL command to select data from an Excel sheet to be inserted into an Access table:

SELECT * FROM [Excel 12.0;HDR=YES;DATABASE=K:\\Folder         


        
相关标签:
1条回答
  • 2021-01-22 16:53

    Well, if somebody else comes accross the same problem:

    The issue reported here is a known bug that happens when a range is queried: Problems in Excel 2013 when using ranges that extend beyond row 65536

    and

    https://chandoo.org/forum/threads/excel-recordset-only-returns-65536-rows-if-you-try-to-pull-data-from-a-range.12492/ )

    To bypass it the solution was to query the range using "[SheetName$A:W]" instead of "[SheetName$A1:W100000]"

    SELECT * FROM [Excel 12.0;HDR=YES;DATABASE=K:\FolderName\FileName.xlsb].[SheetName$A:W] WHERE Data=#01/01/2018#;
    
    0 讨论(0)
提交回复
热议问题