2016-09-28 46 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 \。

我的猜測是斜槓解決了這個問題,但我還沒有測試和發現肯定。

相關問題