Access数据库出现的0x80004005 Unspecified error问题及解决方案。
[OleDbException (0x80004005): Unspecified error]

项目测试时,结果出现了下面这样的问题:

[OleDbException (0x80004005): Unspecified error]   System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20   System.Data.OleDb.OleDbConnection.InitializeProvider() +57   System.Data.OleDb.OleDbConnection.Open() +203   Webb.WAVE.Controls.OleDBManager.FillDataTable(DataTable i_dataTable) +85   Webb.WAVE.Controls.WaveExpire.LoadExpireDateForClient(DataTable i_table, Int64 i_clientID) +189   Webb.WAVE.inc_Client_AccessManage.LoadExpireDate(String i_sortKey) +99   Webb.WAVE.inc_Client_AccessManage.Page_Load(Object sender, EventArgs e) +85   System.Web.UI.Control.OnLoad(EventArgs e) +67   System.Web.UI.Control.LoadRecursive() +35   System.Web.UI.Control.LoadRecursive() +98   System.Web.UI.Control.LoadRecursive() +98   System.Web.UI.Page.ProcessRequestMain() +750

说明一下:这个错误总会在运行一段时间后出现,而等一会工(不定多少时间),或者重新启动IIS或者服务器,这个问题就解决了。而再运行一会又会(时间越来越短)出现这个问题。

而我在自己的电脑是运行时,基本上没出现这样的问题,于是反复的查找原因,不得其解,在MSDN里找到了三篇相关的文章:其中这一篇还有点道理,与我的错误原因达的上边。
ms-help://MS.MSDNQTR.2005APR.1033/enu_kboledb/oledb/251254.htm

SYMPTOMS

When trying to connect to an Access .mdb file, an ODBC error is returned stating "Disk or Network Error". The Microsoft OLE DB Provider for the Microsoft Jet database engine may also return an "Unspecified error" (error code = 0x80004005) message.

The problem can occur only when the data source is opened under the Microsoft Internet Information Server (IIS) or a Microsoft Windows NT service but not under a logged-on user account.

CAUSE

Jet creates a temporary file when the engine is started. In doing so, it first checks the TMP environment variable and uses that path to define where the temporary file is created. If it doesn't see a TMP environment variable, it looks for the TEMP environment variable. If TEMP is not defined, it then uses the Windows folder (\WINDOWS or \WINNT).

If TMP/TEMP is defined but points to a nonexistent folder, the error occurs.

Moreover, when opening the Access database through IIS or a Windows NT service, and when IIS or the service is running under the local system account, the TMP or TEMP system environment variable is used. When the Web services or Windows NT service are started using a user account, the TMP/TEMP user profile environment variables is used.

RESOLUTION

Define a TMP or TEMP environment variable and assign the variable to an existing folder. If you are accessing the Access database from IIS, be certain to check the system environment settings rather than environment variables of the logged-on user. Also ensure that the IUSER anonymous IIS account has access to the temporary folder.

You must restart the computer after changing any environment variables.
Environment variables are set under Windows NT 4.0 by going to the Control Panel and clicking System and then selecting the Environment tab.

然而我不解的是,为什么在前几个星期的测试中没有这个问题,而在最近几天,出现的越来越频繁呢?
在网上找了几篇相关的文章(有好多论坛上的帖子也有讨论这个问题的,但我没能找到解决答案):
http://www.issociate.de/board/post/276824/ASP_Error_0x80004005_Unspecified_Error.html
http://www.sitepoint.com/forums/showthread.php?t=213666
http://support.microsoft.com/default.aspx?scid=kb;en-us;825738

思考几小时间后,我想会不会是不能建立临时文件的原因呢?其实只要能让错误在我自己的电脑上出现,那我就好办了,但问题是,只是偶而出现在我的电脑上,而且很快就好了,从头到尾都只出现过两三次。但在服务器上却出现问题越来越多了,几分钟就不行了。根据前面的一些文章来分析,我决定做以下一个测试:

1、删除IIS在Windows下的帐号(Internet Guest Account)的文件写权限当然,只对项目的目录。
2、同时也删除它在临时目录(C:\Documents and Settings\WEBB-COUNTRY-WU\ASPNET\Local Settings\Temp,不的机器所有不同)的写权限。

好了,终于在我的电脑上也出现了同样的错误,而且所有的与数据库相关的页面都不能访问。而且根据MSDN里的说明,这是因为没有权限在临时目录里写文件而产生的,与之相同。然而,问题又在于,服务器上的并不是一直错误,而是一时错误一时正常。

唯一可以解释的就是服务器临时文件满了!!!!而这又不好证明,我不可能一直测试,让我的临时文件也满了(就算是COPY文件到临时目录里,也不能算是IIS帐号的,而是操作者的),而且临时文件它自己(OLEDB的链接线程)也会删除的。只好另外想办法,就是用磁盘配额。给IIS帐号:Internet Guest Account在C盘只有10K的写权限,然后测试,果然问题如期而致。。。。。。

到此,可以肯定:服务器上的临时文件太多了,看来是要重新启动一下服务器,或者要清理临时文件或者调整磁盘空间了。

转载于:https://www.cnblogs.com/pinnasky/archive/2010/10/21/1857427.html

Access数据库出现的0x80004005 Unspecified error问题相关推荐

  1. mfc搜索新建access字段_MFC ODBC类 Access数据库的操作

    MFC ODBC类 Access数据库的操作 2008年11月17日 新建一个Access数据库,数据库名是data.mdb新建一个表Ttest,两个字段ID,name 表内容如下 ID name 1 ...

  2. PHP通过PDO连接Microsoft Access数据库

    1连接到access数据库 $db = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)}; dbq=" ...

  3. c# dataGridView与access数据库及其增删查改导出报表等

    假如我们要写一个实验室设备管理的一个简单程序,用access数据库可以说是最简单便捷的选择了, Access 是Office里面的一个组件是office自带的数据库. 比如说要做成这样的形式,有数据的 ...

  4. golang odbc mysql_go语言通过odbc操作Access数据库的方法

    本文实例讲述了go语言通过odbc操作Access数据库的方法.分享给大家供大家参考.具体如下: 这里需要用到go-odbc库,下载地址为:https://github.com/weigj/go-od ...

  5. 直接通过ADO操作Access数据库(修改版)

    自身的OLE DB Privider,而且还可以应用所有的ODBC驱动程序.关于OLE DB和ADO的其它详细情况,读者可以自行查阅相关书籍或MSDN,这里就不一一说明了.让我们直接步入主题:如何掌握 ...

  6. 导入EXCEL数据更新access数据库里的信息

    'Public fn As String '保存Access文件名 'Public fn1 As String '保存Excel文件名 'Public fncount As Integer '保存Ac ...

  7. ACCESS数据库的压缩,备份,还原,下载,删除的实现

    以文本方式查看主题 -  企胜MIS开发论坛|ASP.NET|UML| CSS|Access|My SQL|网络营销|JAVA|J2EE|Ajax  (http://www.fleake.com/in ...

  8. ACCESS数据库防下载方法

    下面的方法分别适用有IIS控制权和  虚拟空间的用户! 1:修改 数据库名.这是常用的方法,将数据库名改成怪异名字或长名字以防他人猜测.如果被猜到数据库名则还能下载该数据库文件,但机率不大.如:将数据 ...

  9. ACCESS数据库防下载方法 1

    ACCESS数据库防下载方法 作者:luotoal  来源:网络  点击数: 21131  更新时间:2006年05月21日  ACCESS数据库防下载方法   下面的方法分别适用有IIS控制权和   ...

最新文章

  1. 百度李彦宏:人工智能是万物命脉
  2. 10、如何查看MySQL系统帮助?
  3. java第三阶段源代码_有效Java第三版的源代码已更新为使用较新的功能
  4. 多线程服务器(python 版)
  5. 机器人正改变着全球工业,仅中国去年就买了9万台
  6. sql server 2008 r2安装图解教程
  7. matlab实验教程,matlab实验教程
  8. hgoi#20190517
  9. synchronized锁升级之偏向锁
  10. 人工智能与计算机发展史
  11. 04、Hadoop框架HDFS NN、SNN、DN工作原理
  12. ios app 提交审核
  13. 【高中必修二】几何体
  14. TikTok搬运视频怎么才会不被限流?
  15. 第四章 闪烁探测器----闪烁体、选择原则、光收集系统、PMT、替代产品
  16. 如何使用物联网低代码平台进行设备调试?
  17. 玩转5G之--初探5G网络模型(OSI模型和TCP/IP模型)
  18. Ubuntu查找软件命令
  19. Java中无穷大、无穷小、非数、最大值、最小值
  20. win10去除广告弹窗的有效方法

热门文章

  1. Bootice1.34版本把grub4dos0.46a写入硬盘MBR失败一个例子
  2. scalikejdbc 学习笔记(4)
  3. 使用java底层实现邮件的发送(含测试,源码)
  4. 获取MSSQL Server中的相关信息(视图、存储过程、触发器、表)
  5. MySQL 使用explain查看执行计划
  6. SQLite中不支持的sql语法
  7. C语言学习笔记(五) 数组
  8. 单网卡部署WEB+Mail+FTP+ISA服务器之四:局域网内部署FTP和winwebmail服务器
  9. DevExpress Asp.net(6) ASPxLoadingPanel的基本使用
  10. JQuery 如何选择带有多个class的元素