2016-09-28 45 views
0

我正在开发一个SSIS包,该包使用具有Excel源的数据流任务。连接的提供者是Microsoft.ACE.OLEDB.12.0。网络共享上的Excel文件 - 它已被其他用户专门打开,或者您需要查看和写入其数据的权限

如果我将连接管理器指向我的计算机上的本地文件,并在Visual Studio中运行该包,它将成功完成。

但是,如果我点上我的本地域中的连接管理器到UNC网络共享,并从Visual Studio运行包时,出现以下消息:

Error: 0xC0202009 at MyPackage, Connection manager "Excel Connection Manager": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80004005 Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data.".

Error: 0xC020801C at Data Flow Task, Excel Source [2]: 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.

更多信息:

  • 来自UNC共享的文件与我的本地文件完全相同。
  • 运行包之前,UNC共享中的文件未打开。
  • 我的域用户(用于运行Visual Studio)具有UNC共享所有者权限级别。此外,每个人都有UNC共享的读取权限级别。
  • Run64BitRuntime设置为False(可能不相关)。
  • 我在本地运行Visual Studio。
+0

您是否使用本地VS? –

+0

是的,我正在使用本地VS.我更新了这个问题还包括这个信息。 – ovidiufelixb

+0

只是一个猜测问题。你是否使用循环遍历你的包中的Excel工作表? (Foreach架构行集枚举器任务) –

回答

1

通过使用文件路径的变量解决它,然后使用该变量作为连接的ConnectionString属性的表达式。 我还在包含pash的变量中加了反斜杠,所以不是\ computer \ share \我使用\\ computer \ share \。

我的猜测是斜杠解决了这个问题,但我还没有测试和发现肯定。

相关问题