Access數(shù)據(jù)庫(kù)出現(xiàn)0x80004005問(wèn)題的解決方法
出處:wangzh99 發(fā)布于:2008-08-20 10:27:18
這篇論壇文章著重介紹了Access數(shù)據(jù)庫(kù)出現(xiàn)0x80004005問(wèn)題的解決方法,更多內(nèi)容請(qǐng)參考下文:
項(xiàng)目做了三個(gè)月了,終于也差不多完成了,昨天交去測(cè)試,結(jié)果出現(xiàn)了下面這樣的問(wèn)題:
[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
說(shuō)明一下:這個(gè)錯(cuò)誤總會(huì)在運(yùn)行一段時(shí)間后出現(xiàn),而等一會(huì)工(不定多少時(shí)間),或者重新啟動(dòng)IIS或者服務(wù)器,這個(gè)問(wèn)題就解決了。而再運(yùn)行一會(huì)又會(huì)(時(shí)間越來(lái)越短)出現(xiàn)這個(gè)問(wèn)題。
而我在自己的電腦是運(yùn)行時(shí),基本上沒(méi)出現(xiàn)這樣的問(wèn)題,于是反復(fù)的查找原因,不得其解,在MSDN里找到了三篇相關(guān)的文章:其中這一篇還有點(diǎn)道理:
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.
然而我不解的是,為什么在前幾個(gè)星期的測(cè)試中沒(méi)有這個(gè)問(wèn)題,而在近幾天,出現(xiàn)的越來(lái)越頻繁呢?
在網(wǎng)上找了幾篇相關(guān)的文章(有好多論壇上的帖子也有討論這個(gè)問(wèn)題的,但我沒(méi)能找到解決答案):
思考幾小時(shí)間后,我想會(huì)不會(huì)是不能建立臨時(shí)文件的原因呢?其實(shí)只要能讓錯(cuò)誤在我自己的電腦上出現(xiàn),那我就好辦了,但問(wèn)題是,只是偶而出現(xiàn)在我的電腦上,而且很快就好了,從頭到尾都只出現(xiàn)過(guò)兩三次。但在服務(wù)器上卻出現(xiàn)問(wèn)題越來(lái)越多了,幾分鐘就不行了。根據(jù)前面的一些文章來(lái)分析,我決定做以下一個(gè)測(cè)試:
1、刪除IIS在Windows下的帳號(hào)(Internet Guest Account)的文件寫(xiě)權(quán)限當(dāng)然,只對(duì)項(xiàng)目的目錄。
2、同時(shí)也刪除它在臨時(shí)目錄(C:\Documents and Settings\WEBB-COUNTRY-WU\ASPNET\Local Settings\Temp,不的機(jī)器所有不同)的寫(xiě)權(quán)限。
好了,終于在我的電腦上也出現(xiàn)了同樣的錯(cuò)誤,而且所有的與數(shù)據(jù)庫(kù)相關(guān)的頁(yè)面都不能訪問(wèn)。而且根據(jù)MSDN里的說(shuō)明,這是因?yàn)闆](méi)有權(quán)限在臨時(shí)目錄里寫(xiě)文件而產(chǎn)生的,與之相同。然而,問(wèn)題又在于,服務(wù)器上的并不是一直錯(cuò)誤,而是一時(shí)錯(cuò)誤一時(shí)正常。
可以解釋的就是服務(wù)器臨時(shí)文件滿了?。。?!而這又不好證明,我不可能一直測(cè)試,讓我的臨時(shí)文件也滿了(就算是COPY文件到臨時(shí)目錄里,也不能算是IIS帳號(hào)的,而是操作者的),而且臨時(shí)文件它自己(OLEDB的鏈接線程)也會(huì)刪除的。只好另外想辦法,就是用磁盤(pán)配額。給IIS帳號(hào):Internet Guest Account在C盤(pán)只有10K的寫(xiě)權(quán)限,然后測(cè)試,果然問(wèn)題如期而致。。。。。。
到此,可以肯定:服務(wù)器上的臨時(shí)文件太多了,看來(lái)是要重新啟動(dòng)一下服務(wù)器,或者要清理臨時(shí)文件或者調(diào)整磁盤(pán)空間了……
希望這篇文章能幫助那些還沒(méi)有解決問(wèn)題的人。同時(shí),MS網(wǎng)站及MSDN上的幾篇文章也都還很有幫助意義的,特別是說(shuō)明的其它幾個(gè)錯(cuò)誤原因……
版權(quán)與免責(zé)聲明
凡本網(wǎng)注明“出處:維庫(kù)電子市場(chǎng)網(wǎng)”的所有作品,版權(quán)均屬于維庫(kù)電子市場(chǎng)網(wǎng),轉(zhuǎn)載請(qǐng)必須注明維庫(kù)電子市場(chǎng)網(wǎng),http://www.hbjingang.com,違反者本網(wǎng)將追究相關(guān)法律責(zé)任。
本網(wǎng)轉(zhuǎn)載并注明自其它出處的作品,目的在于傳遞更多信息,并不代表本網(wǎng)贊同其觀點(diǎn)或證實(shí)其內(nèi)容的真實(shí)性,不承擔(dān)此類作品侵權(quán)行為的直接責(zé)任及連帶責(zé)任。其他媒體、網(wǎng)站或個(gè)人從本網(wǎng)轉(zhuǎn)載時(shí),必須保留本網(wǎng)注明的作品出處,并自負(fù)版權(quán)等法律責(zé)任。
如涉及作品內(nèi)容、版權(quán)等問(wèn)題,請(qǐng)?jiān)谧髌钒l(fā)表之日起一周內(nèi)與本網(wǎng)聯(lián)系,否則視為放棄相關(guān)權(quán)利。
- 工業(yè)5G技術(shù)在智能制造中的應(yīng)用與實(shí)踐解析2025/12/31 10:57:21
- 工業(yè)以太網(wǎng)交換機(jī)選型與現(xiàn)場(chǎng)應(yīng)用技術(shù)指南2025/12/18 10:48:14
- 無(wú)線傳輸電路基礎(chǔ),射頻前端設(shè)計(jì)、天線匹配與鏈路預(yù)算計(jì)算2025/10/27 13:55:50
- ASK 解調(diào)的核心要點(diǎn)與實(shí)現(xiàn)方式2025/9/5 16:46:17
- 雙偶極子天線:結(jié)構(gòu)、特性與應(yīng)用全解析2025/9/3 10:29:21
- 編碼器的工作原理及作用1
- 超強(qiáng)整理!PCB設(shè)計(jì)之電流與線寬的關(guān)系2
- 三星(SAMSUNG)貼片電容規(guī)格對(duì)照表3
- 電腦藍(lán)屏代碼大全4
- 國(guó)標(biāo)委發(fā)布《電動(dòng)汽車(chē)安全要求第3部分:人員觸電防護(hù)》第1號(hào)修改單5
- 通俗易懂談上拉電阻與下拉電阻6
- 繼電器的工作原理以及驅(qū)動(dòng)電路7
- 電容單位8
- 跟我學(xué)51單片機(jī)(三):?jiǎn)纹瑱C(jī)串口通信實(shí)例9
- 一種三極管開(kāi)關(guān)電路設(shè)計(jì)10
- 高速PCB信號(hào)完整性(SI)設(shè)計(jì)核心實(shí)操規(guī)范
- 鎖相環(huán)(PLL)中的環(huán)路濾波器:參數(shù)計(jì)算與穩(wěn)定性分析
- MOSFET反向恢復(fù)特性對(duì)系統(tǒng)的影響
- 電源IC在惡劣環(huán)境中的防護(hù)設(shè)計(jì)
- 連接器耐腐蝕性能測(cè)試方法
- PCB電磁兼容(EMC)設(shè)計(jì)與干擾抑制核心實(shí)操規(guī)范
- 用于相位噪聲測(cè)量的低通濾波器設(shè)計(jì)與本振凈化技術(shù)
- MOSFET在高頻開(kāi)關(guān)中的EMI問(wèn)題
- 電源IC在便攜式設(shè)備中的設(shè)計(jì)要點(diǎn)
- 連接器結(jié)構(gòu)設(shè)計(jì)常見(jiàn)問(wèn)題分析









