SSIS错误代码dtse_cannot tacquireconnectionfromconnectionmanager.

本文关键字:cannot tacquireconnectionfromconnectionmanager dtse 错误代码 SSIS | 更新日期: 2023-09-27 18:09:39

我有一个SSIS包,它读取本地系统上的Excel文件(数据流源),并使用OLEDB目的地数据流项将数据传输到SQL Server本地数据库,其中包含派生列和数据转换步骤。我设置:

Run64BitRuntime为False

支持的TransactionOption

DelayValidation为True(数据流任务和连接)

ProtectionLevel作为DontSaveSensitive(因为我使用Windows身份验证)

当不以管理员身份运行BIDS时,我得到一个警告"无法打开全局共享内存"(即使我已经添加了我的帐户用户,这也是Windows性能组的管理员),但软件包执行良好,excel文件中的所有20K+行都导入到表中。当从cmd调用时,它也运行良好。

现在,我的要求是从API调用这个包。下面是我用来调用这个包的基本代码:

Package pkg;
Application app = new Application();
DTSExecResult pkgResults;
Variables vars;
string FileName = @"D:'Users'rohit'Documents'Visual Studio 2008'Projects'OutboundPerformance'SalesPerf'ExcelDataInput.dtsx";
pkg = app.LoadPackage(FileName, null);
vars = pkg.Variables;
vars["var_fk_CampaignId"].Value = ddlCampaignName.SelectedValue;
pkgResults = pkg.Execute(null, vars, null, null , null);
if (pkgResults == DTSExecResult.Success)
lblerror.Text = "Package executed";
else
lblerror.Text = "Package failed";

并且包执行失败并出现错误(从SSIS日志到文本文件):

Diagnostic,M02697,IIS APPPOOL'ASP.NET v4.0,Excel Connection Manager,{8EECAC3E-7A77-43E8-AD03-B734D273E489},{2AC52183-188B-4B82-BB67-D5112FE08710},20/06/2014 17:16:40,20/06/2014 17:16:40,0,0x,ExternalRequest_post: 'IDBInitialize::Initialize failed'. The external request has completed.
OnError,M02697,IIS APPPOOL'ASP.NET v4.0,Data Flow Task,{F2934EFE-11E9-4A70-80D6-EB7143A07745},{2AC52183-188B-4B82-BB67-D5112FE08710},20/06/2014 17:16:40,20/06/2014 17:16:40,-1071611876,0x,SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
OnError,M02697,IIS APPPOOL'ASP.NET v4.0,ExcelDataInput,{FCEC3902-379C-4D69-9135-0246FC60AEAE},{2AC52183-188B-4B82-BB67-D5112FE08710},20/06/2014 17:16:40,20/06/2014 17:16:40,-1071611876,0x,SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
OnError,M02697,IIS APPPOOL'ASP.NET v4.0,Data Flow Task,{F2934EFE-11E9-4A70-80D6-EB7143A07745},{2AC52183-188B-4B82-BB67-D5112FE08710},20/06/2014 17:16:40,20/06/2014 17:16:40,-1073450985,0x,component "Excel Source" (307) failed validation and returned error code 0xC020801C.

我已经尝试给访问权限IIS_USERS, SQL dts和代理用户的excel文件,SQL临时目录和文件(读和写)和excel文件不被任何其他进程锁定。我正在运行windows 7 32位,Run64BitRuntime设置为False。

现在,我都试过了,Windows身份验证以及SQL身份验证(复选框选中保存密码和保护级别设置为EncryptSensitiveWithUserKey)。

SSIS错误代码dtse_cannot tacquireconnectionfromconnectionmanager.

感谢billinkc指出缺失的链接。我把App Pool的身份改成了Local System,效果非常好。

https://i.stack.imgur.com/yakxX.jpg

感谢Vikramsinh Shinde的时间和建议。