mini-software / MiniExcel

Fast, Low-Memory, Easy Excel .NET helper to import/export/template spreadsheet (support Linux, Mac)
https://www.nuget.org/packages/MiniExcel/
Apache License 2.0
2.69k stars 329 forks source link

生成的xlsx文件不能使用OLEDB方式导入数据库 #330

Open peterd1228 opened 2 years ago

peterd1228 commented 2 years ago

Excel Type

阿翰: 你好! 今天打算将生成的文件导入MSSQL库,使用

INSERT INTO table select * from OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=Yes;IMEX=1;Database=','sql语句')

报错 External table is not in the expected format.

如果 将 excel文件 另存为 还是这个格式,这个导入就能成功。

可能这个也不算bug,但我也没找到这个具体是什么格式,还请解下惑,谢谢!

MiniExcel Version

Description

densen2014 commented 1 year ago

我的解决方案是统一优先 miniexcel读取 OLEDB 后备.

shamork commented 1 year ago

我使用Navicat导入也是报错,使用office另存为xlsx后也不行,但另存为xls后就可以了