堆栈跟踪的 oledb 连接错误
大家好 我正在 ASP.net 中做 CRM 应用程序。我使用 MS Access 作为后端。在本地主机上,当相同的应用程序上传到服务器上时,不会发生任何 oledb 异常错误,然后会发现 oledb 异常(有时并非总是如此,但当找到 oledb 异常时,会连续发生相同的错误),
下面我在 web.config 中使用连接字符串代码文件
<connectionStrings>
<add name="SolDBConnectionstring" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\KRISP.mdb;Persist Security Info=True"
providerName="System.Data.OleDb" />
</connectionStrings>
& Dataaccess.vb 文件中使用其他代码打开连接
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbConnection
Public Class DataAccess
#Region "VARIABLE DECLARATIONS"
Dim strErrorMsg As String = ""
Public bSuccess As Boolean
Dim objConnection As OleDbConnection
Dim objCommand As OleDbCommand
Dim objDTAdapter As OleDbDataAdapter
#End Region
Private Sub OpenConnection()
Try
Me.objConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings.Item("SolDBConnectionstring").ConnectionString)
Me.objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|KRISP.mdb;Persist Security Info=True")
If objConnection.State = ConnectionState.Closed Then
Me.objConnection.Open()
End If
Catch ex As Exception
Throw ex
End Try
End Sub
错误是:
未指定的错误
描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.Data.OleDb.OleDbException:未指定的错误
源错误:
行 494:'End If 第 495 行:捕获 ex 作为异常 第 496 行:抛出 ex 第 497 行: 第 498 行:最后
源文件:d:\hosting\nitindia\App_Code\EmployeeManager.vb 行:496
堆栈跟踪:
[OleDbException (0x80004005):未指定的错误] EmployeeManager.isUser(String strUID, String strPswd) 在 d:\hosting\nitindia\App_Code\EmployeeManager.vb:496 d:\hosting\nitindia\Employees.aspx.vb:37 中的Employees.BtnSubmit_Click(对象发送者,EventArgs e) 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(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint)+1565
所以请检查上面的代码&如果您找到上述问题的任何解决方案。请用您的逻辑回复。
Hi All
I'm doing CRM Application in ASP.net. for which i use MS Access as back end. On Localhost no any oledb exception error occure while the same application upload on server then there will find oledb exception (occasionally not always,but when find oledb exception then continuously same error occure)
below I'm using code for connection string in web.config file
<connectionStrings>
<add name="SolDBConnectionstring" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\KRISP.mdb;Persist Security Info=True"
providerName="System.Data.OleDb" />
</connectionStrings>
& other code use in Dataaccess.vb file for connection open
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbConnection
Public Class DataAccess
#Region "VARIABLE DECLARATIONS"
Dim strErrorMsg As String = ""
Public bSuccess As Boolean
Dim objConnection As OleDbConnection
Dim objCommand As OleDbCommand
Dim objDTAdapter As OleDbDataAdapter
#End Region
Private Sub OpenConnection()
Try
Me.objConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings.Item("SolDBConnectionstring").ConnectionString)
Me.objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|KRISP.mdb;Persist Security Info=True")
If objConnection.State = ConnectionState.Closed Then
Me.objConnection.Open()
End If
Catch ex As Exception
Throw ex
End Try
End Sub
Error is:
Unspecified 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
Source Error:
Line 494: 'End If
Line 495: Catch ex As Exception
Line 496: Throw ex
Line 497:
Line 498: Finally
Source File: d:\hosting\nitindia\App_Code\EmployeeManager.vb Line: 496
Stack Trace:
[OleDbException (0x80004005): Unspecified error]
EmployeeManager.isUser(String strUID, String strPswd) in d:\hosting\nitindia\App_Code\EmployeeManager.vb:496
Employees.BtnSubmit_Click(Object sender, EventArgs e) in d:\hosting\nitindia\Employees.aspx.vb:37
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110System.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
So Please check above code & if you find any solution for above problem.please reply with your great logic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论