XML 导入语法的后期绑定转换
我有一个 Access 应用程序,它实际上只是一堆办公应用程序(Word、Excel、Ppt 和 Outlook)的自动化服务器,它导入信息,通过表单收集信息并生成各种文件。
它不用作传统意义上的数据库,而是用户在现场使用所有自动化技巧的远程文件,然后在构建了需要的所有文件后将其丢弃。
最近,这里的人们帮助我转换为后期绑定,以使我免受目标系统上破坏功能的引用的影响。效果很好!
所以现在我有一些 xml 导入代码,需要设置 xml v5 才能运行。现在我之前遇到的问题是 Excel、Powerpoint 和 Excel。 Outlook 对象库引用从 Office 版本更改为版本(2003 = 11.0、2007 - 12.0 等),但我想知道这里是否会遇到同样的问题。让事情变得更复杂的是,我不知道它可以在服务器/操作系统上运行(XP、Vista、2003、2008 SP2 等)。老实说,我不知道这是否重要,所以这就是我提到它的原因。
那么,如果它实际上会产生问题,那么有人知道为此声明的后期绑定转换示例吗?它似乎与创建和办公应用程序不一样...
Sub PullingDataFromNodes()
dim xmlDoc as MSXML2.DOMDocument50
dim xmlNodeList As MSXML2.IXMLDOMNodeList
dim myNode as MSXML2.IXMLDOMNode
Set xmldoc = New MSXML2.DOMDocument50
xmldoc.async = False
xmldoc.Load ("C:/SomeFolder/xml.xml")
Set xmlNodeList = xmldoc.SelectNodes("//DataFieldNode")
Set myNode = xmlNodeList.item(0)
'etc...more of the same....pull data from node, place data into variable, then place
' data in variable into recordset, use it to update table kind of thing
所以我尝试使用 CreateObject 来实现这一点,但它似乎不起作用...任何人都可以提供这方面的建议吗?
当我可以使用 argus 时,我使用 xmlImport...但是这个特定的解决方案是通过 Web 应用程序提供的数据,它们既没有嵌入架构,而且我没有样式表或 .xsd
I have an Access application that is really just an automation server for a bunch of office apps (Word, Excel, Ppt & Outlook), takes information imported, and gathered through forms and produces all kinds of files.
It is not used as a database in the traditional sense, rather a remote file users utilize in the field for all the automation tricks, and then discard when they have all the files built then need.
So recently so folks here helped me out with converting to late binding as to save me from the brocken references on a target system killing the functionality. It is working great!
So now I have some xml import code that requires xml v5 to be set in order to run. Now the problem I had before was the Excel, Powerpoint & Outlook object library references changing from office version to version (2003 = 11.0, 2007 - 12.0, etc), but I am wondering if I am going to have the same problem here. To make things more complicated I have no idea was Server/OS this may be run on (XP, Vista, 2003, 2008 SP2, etc). I honestly do not know if that will matter, so that is why I mention it.
So, if it in fact will create a problem, then does anyone have an idea of a late binding conversion example for declarations for this? It doesn't seem to be the same as creating and office app...
Sub PullingDataFromNodes()
dim xmlDoc as MSXML2.DOMDocument50
dim xmlNodeList As MSXML2.IXMLDOMNodeList
dim myNode as MSXML2.IXMLDOMNode
Set xmldoc = New MSXML2.DOMDocument50
xmldoc.async = False
xmldoc.Load ("C:/SomeFolder/xml.xml")
Set xmlNodeList = xmldoc.SelectNodes("//DataFieldNode")
Set myNode = xmlNodeList.item(0)
'etc...more of the same....pull data from node, place data into variable, then place
' data in variable into recordset, use it to update table kind of thing
So I tried to use CreateObject with this, and it doesn't seem to work....can anyone offer and advice with this?
I use xmlImport when I can with argus....but this particular solution is for data is the provided through a web app for which they neither embed the schema, and I don't have a style sheet or .xsd
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有类似的代码,使用 MSXML2.DOMDocument.3.0,所以我将其切换到 5,它仍然有效。我不知道不同版本的情况。我只能建议你尝试这种方式,看看会发生什么。
I had similar code which uses MSXML2.DOMDocument.3.0, so I switched it to 5 and it still works. I don't know about the different versions. I can only suggest you try it this way and see what happens.