首页 > 解决方案 > MS Access: Why does the asynch method cause "Run-time error 424: Object required" on an XML/DOM file?

问题描述

I am trying to write a simple MS Access application to read a collection of files in XML format. I've written a few lines of code that should take a document name supplied via a form, open the document, a display some detail of the contents. However, the code always fails at a preliminary step with the asynch method. Taking this out would cause the rest of the code to execute before the document is loaded so it is a mandatory step.

I've checked the libraries referenced and tried to instantiate the document as "microsoft.XMLDOM", "MSXML2.DOMDocument" and "MSXML2.DOMDocument.6.0" but still get the same error.

The code fails at the line "Set xmlDoc.async = False" with run-time error 424.

The libraries referenced are:

标签: xmlvbams-accessdom

解决方案


设置“某些对象”= true/false 不是您想要的。

你要:

xmlDoc.async = False

使用“set”这个词是为了设置一个对象,而不是改变 xml doc 的某些属性或方法。


推荐阅读