【问题标题】:How to pass error information from oracle to access如何将错误信息从 oracle 传递给访问
【发布时间】:2016-12-20 10:30:38
【问题描述】:

我有 Oracle DB,里面有包。我也有 MS Access 作为这个数据库的前端。

现在当我在 oracle 中遇到错误时,在访问中我只收到 ODBC 错误。

是否有任何解决方案可以将错误信息(编号、desc)从 Oracle 传递到 Access?

【问题讨论】:

  • 抱歉,我的帖子有什么问题?我在stackoverflow中寻找答案,但我没有找到任何...
  • 在 SO 上不欢迎没有任何研究努力或尝试的问题,例如“如何做到这一点?”。

标签: oracle ms-access plsql vba


【解决方案1】:

循环通过 DBEngine.Errors 集合。错误捕获应如下所示:

On Error GoTo ErrorTrap
    ' Execute connect code at this point
Exit_errortrap:
    Exit Sub
ErrorTrap:
    Dim myerror As Error
    For Each myerror In DBEngine.Errors
        With myerror
            If .Number <> 3146 Then
                MsgBox .Description
            End If
        End With
    Next
    Resume Exit_errortrap

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多