重命名文件后访问文件的问题

发布于 2025-01-24 09:19:06 字数 736 浏览 3 评论 0原文

步骤1:首先,我有一个脚本任务,可以在特定位置获取Excel文件并删除几行数据,然后将文件重命名为“ report.xlsx”同一位置。

STEP2:现在我有了数据流任务,我已经使用Excel源来加载Excel文件,通过在Excel Connection Manager的Excel文件路径中指定“ Filepath+report.xlsx”,然后选择Sheep1 $作为Excel的名称。床单。

我的目标是在该位置=&gt中获取文件;将文件重命名为“ report.xlsx” =>然后将数据从Excel加载到表。

但是当我运行报告时,我会收到以下错误

work_data的错误[excel source [2]]:SSIS错误代码DTS_E_OLEDBERROR。发生了OLE DB错误。错误代码:0x80040E37。

work_data [excel source [2]]的错误:打开“ sheet1 $”失败的行集。检查对象是否存在于数据库中。

work_data [ssis.pipeline]的错误

work_data [ssis.pipeline]的错误]:一个或多个组件失败验证。

work_data的错误:任务验证期间存在错误。

我的猜测是,Excel Connection Manager试图访问report.xlsx报告,该报告在重命名之前不会存在(我猜)。

有没有办法实现我的目标?

Step1: I have a script task at first to get excel file at a specific location and delete few lines of data and then rename the file to "Report.xlsx" the same location.

Step2: Now I have a Data Flow task, I have used an Excel Source to load rename excel file by specifying the "FilePath+Report.xlsx" in the Excel File Path of Excel Connection Manager and selected the Sheet1$ as Name of the Excel sheet.

My Goal is to get the file in that location => rename the file to "Report.xlsx" => then load the data from excel to table.

But when I run the report, I am getting the below error

Error at Work_Data [Excel Source [2]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.

Error at Work_Data [Excel Source [2]]: Opening a rowset for "Sheet1$" failed. Check that the object exists in the database.

Error at Work_Data [SSIS.Pipeline]: "Excel Source" failed validation and returned validation status "VS_ISBROKEN".

Error at Work_Data [SSIS.Pipeline]: One or more component failed validation.

Error at Work_Data: There were errors during task validation.

My guess is that, the Excel Connection Manager trying to access the Report.xlsx report which will not be there before renaming (I guess).

Is there a way to achieve my Goal ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文