Access 2013和Access 2016之间的错误号已更改 [英] Error number changed between Access 2013 and Access 2016

查看:130
本文介绍了Access 2013和Access 2016之间的错误号已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您尝试加载两次功能区,则会在Access 2007-2013和Access 2016中获得不同的错误编号(Err.Number)。


例如,如果您执行以下方法
两次

 Public Sub RibbonErrorTest() 

Dim xml As String
xml = _
"<?xml version ="" 1.0""编码= QUOT;" UTF-8英寸;"?>" &安培; _
"< customUI xmlns ="" http://schemas.microsoft.com/office/2006/01/customui"">" &安培; _
" <色带>" &安培; _
" <凸片>" &安培; _
" < tab id ="" test_ribbon_tab"" label ="" Test Ribbon""" &安培; _
" < /标签>" &安培; _
" < /选项卡>" &安培; _
" < /色带>" &安培; _
"< / customUI>"

Application.LoadCustomUI" test_ribbon",xml

End Sub

您在Access 2007中收到以下错误消息-2013(抱歉本地化的错误消息):



以及Access 2016中的以下消息(使用Office 2016版本1705 Build 8201.2102即点即用测试):



添加错误处理程序时可以观察到同样的问题检查Err.Number:Access 2007-2013返回32609,Access 2016返回32610.(这实际上是我们发现此问题的方式。)


这是......非常不方便,因为这是自定义错误处理程序的重大更改。 (是的,我知道在控制流中使用错误处理程序是不好的做法,但是我们都知道有些情况下Access无法做出其他选择。)


这个变化是否记录在某处?这只是一个"故障"吗?在LoadCustomUI中,或者在将Access 2016添加到我们的应用程序支持的Access版本列表时,我们应该注意其他错误号更改吗?


谢谢,最好的问候

Heinzi


解决方案

是的,它是错误数字改变时的痛苦,但我已经看到,在我开发Access应用程序的20多年中,这种情况多次发生。事实上,我有同样的错误在同一个
版本中抛出完全不同的数字和描述。我不知道它的时间,其他进程是否正在运行或只是无意义。


我从未见过任何关于错误编号的文档,甚至认为这会非常有帮助。


If you try to load a ribbon twice, you get different error numbers (Err.Number) in Access 2007-2013 and Access 2016.

For example, if you execute the following method twice:

Public Sub RibbonErrorTest()

    Dim xml As String
    xml = _
        "<?xml version=""1.0"" encoding=""UTF-8""?>" & _
        "<customUI xmlns=""http://schemas.microsoft.com/office/2006/01/customui"">" & _
        "  <ribbon>" & _
        "    <tabs>" & _
        "      <tab id=""test_ribbon_tab"" label=""Test Ribbon"">" & _
        "      </tab>" & _
        "    </tabs>" & _
        "  </ribbon>" & _
        "</customUI>"
    
    Application.LoadCustomUI "test_ribbon", xml

End Sub

you get the following error message in Access 2007-2013 (sorry for the localized error message):

and the following message in Access 2016 (tested with Office 2016 Version 1705 Build 8201.2102 Click-to-Run):

The same issue can be observed when adding an error handler and checking Err.Number: Access 2007-2013 return 32609, Access 2016 returns 32610. (This is actually how we discovered this issue.)

This is ... quite inconvenient, since this is a breaking change for custom error handlers. (Yes, I know it's bad practice to use error handlers for control flow, but we all know that there are cases where Access leaves you no other choice.)

Is this change documented somewhere? Is this just a "glitch" in LoadCustomUI or are there other error number changes that we should be aware of when adding Access 2016 to the list of Access versions supported by our application?

Thanks, best regards
Heinzi

解决方案

Yes, it's a pain when error numbers change, but I've seen that happen many times over the 20+ years that I have been developing Access applications. In fact, I've had the same error throw completely different numbers and descriptions within the same version. I don't know if it's timing, other processes running or just nonsense.

And I've never seen any documentation on error numbers even thought that would be extremely helpful.


这篇关于Access 2013和Access 2016之间的错误号已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆