堆栈跟踪的oledb连接错误

时间:2011-02-22 05:22:10

标签: .net ms-access oledbexception

大家好        我在ASP.net上做CRM应用程序。我使用MS Access作为后端。在Localhost上,当同一个应用程序在服务器上传时,没有任何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行:'结束如果 第495行:Catch ex As Exception 第496行:扔前 第497行: 第498行:最后

源文件:d:\ hosting \ nitindia \ App_Code \ EmployeeManager.vb行:496

堆栈追踪:

  

[OleDbException(0x80004005):未指定错误]       在d:\ hosting \ nitindia \ App_Code \ EmployeeManager.vb中的EmployeeManager.isUser(String strUID,String strPswd):496       在d:\ hosting \ nitindia \ Employees.aspx.vb中的Employees.BtnSubmit_Click(Object sender,EventArgs e):37       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

所以请检查上面的代码&amp;如果您找到上述问题的任何解决方案,请用您的逻辑回复。

0 个答案:

没有答案