SSIS Excel 连接字符串扩展属性:HDR=YES;出现两次

SSIS Excel Connection String Extended Properties: HDR=YES; Appears Twice

我可以通过批处理文件执行我的 SSIS,但我无法在 Visual Studio 2010 年执行它。我们将它用于我们的计划作业,所以它很好。

我正在从 SQL 服务器提取记录并生成 Excel 文档。我在执行批处理文件时使用的是 DTS 配置文件,因此没有错误。

不过,我也想 运行 在 Visual Studio 中使用它。

这是因为Excel中的连接字符串Visual Studio如下:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=xxx.xls;Extended Properties=HDR=YES;EXCEL 8.0;HDR=YES; 

请问为什么HDR=YES会出现两次,如何解决以上问题?

Connecting to Excel

The Microsoft Jet provider is used to connect to an Excel workbook. In the following connection string, the Extended Properties keyword sets properties that are specific to Excel. "HDR=Yes;" indicates that the first row contains column names, not data, and "IMEX=1;" tells the driver to always read "intermixed" data columns as text.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""

Note that the double quotation character required for the Extended Properties must also be enclosed in double quotation marks.