Access數據庫出現0x80004005問題的解決方法
發布時間:2008/8/21 0:00:00 訪問次數:1096
這篇論壇文章著重介紹了access數據庫出現0x80004005問題的解決方法,更多內容請參考下文:
項目做了三個月了,終于也差不多完成了,昨天交去測試,結果出現了下面這樣的問題:
[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里找到了三篇相關的文章:其中這一篇還有點道理:
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.
然而我不解的是,為什么在前幾個星期的測試中沒有這個問題,而在最近幾天,出現的越來越頻繁呢?
在網上找了幾篇相關的文章(有好多論壇上的帖子也有討論這個問題的,但我沒能找到解決答案):
思考幾小時間后,我想會不會是不能建立臨時文件的原因呢?其實只要能讓錯誤在我自己的電腦上出現,那我就好辦了,但問題是,只是偶而出現在我的電腦上,而且很快就好了,從頭到尾都只出現過兩三次。但在服務器上卻出現問題越來越多了,幾分鐘就不行了。根據前面的一些文章來分析,我決定做以下一個測試:
1、刪除iis在windows下的帳號(internet guest account)的文件寫權限當然,只對項目的目錄。
2、同時也刪除它在臨時目錄(c:\documents and settings\webb-countr
這篇論壇文章著重介紹了access數據庫出現0x80004005問題的解決方法,更多內容請參考下文:
項目做了三個月了,終于也差不多完成了,昨天交去測試,結果出現了下面這樣的問題:
[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里找到了三篇相關的文章:其中這一篇還有點道理:
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.
然而我不解的是,為什么在前幾個星期的測試中沒有這個問題,而在最近幾天,出現的越來越頻繁呢?
在網上找了幾篇相關的文章(有好多論壇上的帖子也有討論這個問題的,但我沒能找到解決答案):
思考幾小時間后,我想會不會是不能建立臨時文件的原因呢?其實只要能讓錯誤在我自己的電腦上出現,那我就好辦了,但問題是,只是偶而出現在我的電腦上,而且很快就好了,從頭到尾都只出現過兩三次。但在服務器上卻出現問題越來越多了,幾分鐘就不行了。根據前面的一些文章來分析,我決定做以下一個測試:
1、刪除iis在windows下的帳號(internet guest account)的文件寫權限當然,只對項目的目錄。
2、同時也刪除它在臨時目錄(c:\documents and settings\webb-countr