需要一些诊断SEHException的帮助外部组件引发了异常

问题描述

使用VB.Net和VS2012的Windows Forms应用程序。使用Access Runtime 2013连接到Access数据库。该应用程序已编译为目标x86。该问题是间歇性的,随机出现在多台不同的PC上,并访问本地硬盘上的数据库

Using cn As New OleDbConnection
  Sy@R_502[email protected] = Sy@R_502[email protected]
  If Not OpenDBConnection(cn) Then
      Sy@R_502[email protected] = Sy@R_502[email protected]
      MsgBox("Unable to make database connection to update screen status.",MsgBoxStyle.OkOnly,"Database Connection Error (MMUN1)")
      Exit Sub
  End If
'continue processing....
 end using

Public Function OpenAccessConnection(ByRef conn As OleDb.OleDbConnection) As Boolean
    Dim builder As New OleDbConnectionStringBuilder()

    'conn.Provider = "Microsoft.ACE.OLEDB.12.0"       
    Try
        builder.ConnectionString = "Data Source=" & dpath & dbnAME
        builder.Add("Provider","Microsoft.ACE.OLEDB." & ACCESsveR & ".0")  'ACCESsveR is '12'
        conn.ConnectionString = builder.ConnectionString
        Sy@R_502[email protected] = Sy@R_502[email protected]
        conn.open()
        Sy@R_502[email protected] = Sy@R_502[email protected]
        Return True
    Catch ex As Exception
        MsgBox("Unable to make Access connection.  Error# " & Err.Number & " " & ErrorToString() & " " & ex.ToString,"Database Connection Error (OLEOPN1)")
        Return False
    Finally
        builder.Clear()
        builder = nothing
    End Try
End Function

Public Function OpenDBConnection(ByRef conn As OleDbConnection) As Boolean
'I kNow this is an extraneous function call but it is in transition from multiple prior uses and I thought I had better not exclude it from this post in case it mattered for some reason
    OpenDBConnection = OpenAccessConnection(conn)
End Function

间歇性返回错误

SEHException

我已经阅读了许多有关此主题文章,但没有找到解决方案,并且坦率地说,我不确定在哪里寻找。难道是来自较早的应用程序错误?线程/ STA问题?如果是这样,我该怎么办?在开发机器上,有时我会看到disconnectedContext错误,但没有看到运行发行版的PC上出现的外部组件错误。这些有关系吗?同样,有一些到数据库的ADO(ADODB)连接(仍在尝试替换/升级),但是在建立新连接时这些连接没有打开。但这可能是连接池问题吗?预先感谢您提供的任何帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)