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" connectionS开发者_StackOverflow社区tring="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) +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
So Please check above code & if you find any solution for above problem.please reply with your great logic.
精彩评论