System.Data.OleDb.OleDbException:未指定的错误
我是 ASP.net 的新手,目前正在开发 CRM 应用程序。该项目使用 .mdb
文件作为后端,但我收到以下运行时错误:
描述:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:
System.Data.OleDb.OleDbException: 未指定的错误 堆栈跟踪:
[OleDbException (0x80004005): 未指定错误]
EmployeeManager.isUser(字符串 strUID, 字符串 strPswd) 中 d:\hosting\nitindia\App_Code\EmployeeManager.vb:481 员工.BtnSubmit_Click(对象 发送者、EventArgs e) 中 d:\hosting\nitindia\Employees.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(字符串 事件参数)+110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String 事件参数)+10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler) 源控件,字符串事件参数) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection 发布数据)+36
System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔值 includeStagesAfterAsyncPoint) +1565
仅当我们上传这些页面时才会出现上述错误在线测试。在 localhost
上运行时,不会引发错误。
这个问题的原因是什么,解决方法是什么?
I'm Totally new in ASP.net and currently working on a CRM application. This project uses .mdb
files as backend but I am getting the following runtime error:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.Data.OleDb.OleDbException:
Unspecified error
Stack Trace:[OleDbException (0x80004005):
Unspecified error]
EmployeeManager.isUser(String strUID,
String strPswd) in
d:\hosting\nitindia\App_Code\EmployeeManager.vb:481
Employees.BtnSubmit_Click(Object
sender, EventArgs e) in
d:\hosting\nitindia\Employees.aspx.vb:35
System.Web.UI.WebControls.Button.OnClick(EventArgs
e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
+13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +1565
The above error occurs only when we upload these pages & test online. When running on localhost
the error is not being raised.
What is the cause of this issue, and solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个错误大多属于权限错误,针对这个错误我们根据情况有多种解决方案
将impersonate=false放入web.config文件中。
如果您想在这种情况下设置 impersonate = true,您需要提供对“C:\Documents and Settings\server name\ASPNET”文件夹的读/写权限来模拟用户,或者通过进程监视器实用程序您可以检查哪个文件没有足够的权限。
如果您有 Windows Server 2008,那么您将找不到 ASPNET 文件夹,并且仍然想要 impersonate=true,那么您需要更改 IIS 7.5/7.0 中的配置。
转到 IIS ->选择您的应用程序池 ->高级设置->进程模型 ->Identity=ApplicationPoolIdentity
转到 IIS ->;选择您的应用程序池 ->高级设置->加载用户配置文件 = False
请参阅此处了解更多详细信息。
This error mostly belongs to permission error, for this error we have mutiple solutions as per situation
Put the impersonate=false in web.config file.
If you want to put the impersonate = true in that case you need to provide the read/write permission to impersonate user on "C:\Documents and Settings\server name\ASPNET" folder or through process monitor utility you can check which file don't have sufficient permission.
If you have windows server 2008 then you will not found the ASPNET folder and still want impersonate=true then you need to change the configuration in IIS 7.5/7.0.
Go to IIS -> select your application pool -> Advanced Setting -> Process Model ->Identity=ApplicationPoolIdentity
Go to IIS -> select your application pool -> Advanced Setting -> Load User Profile = False
See here for more details.
这两种情况都可能导致出现此错误(名称无益):
ASPNET 帐户没有打开文件的权限。
数据库文件已被其他用户锁定。
Both of these conditions may cause this (rather unhelpfully named) error to occur:
The ASPNET account not having permissions to open the file.
The database file is locked by another user.
对于答案查找者:
尝试查看 https://learn.microsoft。 com/en-us/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis# using-process-monitor-to-gather-more-information 并设置临时文件夹的权限
PS 在我的例子中,它是模拟无权访问当前用户临时文件夹 C:\Users\`Username` 的用户\应用程序数据\本地\临时\
for answer finders :
try to look into https://learn.microsoft.com/en-us/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis#using-process-monitor-to-gather-more-information and set Permissions on the Temporary Folders
PS in my case it was impersonate user who does not have access to current user temp folder C:\Users\`Username`\AppData\Local\Temp\