首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Error code: 0x80004005 "The Microsoft Access database engine cannot open or

2013-10-08 
Error code: 0x80004005 The Microsoft Access database engine cannot open or write to the file 前两

Error code: 0x80004005 "The Microsoft Access database engine cannot open or write to the file ''

前两天做了一个SSIS的Package,用来循环Excel然后倒入到数据库。在开发环境可以正常工作,但是真正部署到SQL Agent后发现Job一直失败。

 

打开Job History看到下面的错误:

 

Description: SSIS Error CodeDTS_E_OLEDBERROR.  An OLE DB error hasoccurred. Error code: 0x80004005.  An OLEDB record is available.  Source:"Microsoft Access Database Engine" Hresult: 0x80004005  Description:"The Microsoft Accessdatabase engine cannot open or write to the file ''. It is already openedexclusively by another user, or you need permission to view and write itsdata.".

 

单单看上面的错误一般会认为是权限不够或者文件被打开。但是我看了一下文件夹目录根本没有文件,而且权限也没有问题。直接在开发环境运行也正常。

 

从网上查了一下发现虽然使用了变量来保存Excel名称,但是由于在设置Excel Connection Manger的时候,指定了Excel文件地址的(如图),所以在部署完成后还是会去查找这个文件。

Error code: 0x80004005 "The Microsoft Access database engine cannot open or write to the file ''

  

由于这个文件被删除了,SSIS Job在运行的时候找不到就报错(感觉这个设计很垃圾)。

 

解决办法:

 

在原始的Excel地址重新放一个Excel文件,可以让SSIS Job找到。

 

另外可以考虑将Delay Validation的属性调整为”Ture” 这样在运行的时候验证。

 

 

热点排行