访问VBA和Web服务(XML) [英] Access VBA and Web Services (XML)

查看:61
本文介绍了访问VBA和Web服务(XML)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个跟踪股权补偿的数据库(股票期权,股票

单位等)。每次发行/行使/处理这些

工具,我需要高股价和低股价,以便b $ b b计算适当的税收收益(给定的平均价格) >
天)。在过去,这是以不可接受的

错误率手动完成的(一个人去bigcharts.com,输入所有的东西,

然后写下来高/低价格)。我找到了一个XML Web

服务,它产生了我需要的愚蠢便宜的信息。我的问题

是:甚至可以在VBA中使用这项服务,或者我应该直接转到VB.Net(我有两个,但是我''我更有经验

与VBA,我之前从未使用过Web服务。)


谢谢,

Johnny

Hi all,

I have a database that tracks equity compensation (Stock options, stock
units, etc.) For every issuance/exercise/disposition of these
instruments, I need a high stock price and low stock price in order to
compute the proper gain for tax purposes (average price on a given
day). In the past, this have been done manually at an unacceptable
rate of error (a person goes to bigcharts.com, types all the stuff in,
and then writes down the high/low price). I have found an XML Web
Service that produces the info I need for stupid cheap. My question
is: is it even possible to consume this service in VBA, or should I
just go straight to VB.Net (I have both, but I''m much more experienced
with VBA, and I''ve never used a Web Service before.)

Thanks,
Johnny

推荐答案

Johnny,


您应该可以使用VB发送SOAP使用库从Web服务请求和处理XML

响应

Microsoft SOAP类型库(mssoap1.dll或更高版本)

Microsoft XML(msxml3.dll或更高版本)


您可能还想查看SOAP工具包

http://www.microsoft.com/downloads /d...displaylang=en

如果你决定采用VB路线并陷入困境,我会有点代码

我可以发送给你,让你开始。


另一方面,提供和使用网络服务都是

使用.NET框架非常简单。如果您使用Visual

Studio.NET,您只需添加一个URL引用到Web服务,

IDE会自动为

服务。那时你有智能感知来指导你

使用这些方法。什么可以更容易?


如果Web服务方面是您的应用程序的主要部分,或者您希望

更熟悉.NET,它可能更适合你使用

..NET。另一方面,如果Web服务组件只是谜题的一小部分,并且您有时间限制,那么您可能最好使用

来访问Web服务你的Access项目中的VB。


比尔E.

好​​莱坞,佛罗里达

Johnny,

You should be able to use VB to send SOAP requests and process XML
responses from the web service using the libraries

Microsoft SOAP Type Library (mssoap1.dll or later)
Microsoft XML (msxml3.dll or later)

You may also want to look at the SOAP toolkit at

http://www.microsoft.com/downloads/d...displaylang=en

If you decide to go the VB route and get stuck, I have a bit of code
that I can send you to get you started.

On the other hand, both providing and consuming web services is
extremely simple using the .NET framework. If you use Visual
Studio.NET, you simply add a URL reference to the web service and the
IDE automatically creates a proxy for the various methods exposed in
the service. At that point you have intellisense to guide you as you
make use of the methods. What could be easier?

If the web services aspect is a major part of your app or if you want
to get more familiar with .NET, it may be better for you to work with
..NET. On the other hand, if the web services component is only a small
part of the puzzle and you are time constrained, you may be better off
accessing the web services using VB in your Access project.

Bill E.
Hollywood, FL


您如何看待为Web服务编写.Net包装器和

在VBA中设置对它的引用(我只需要一小部分内容的

通过这项服务提供)?另外,如果你愿意的话,我很想拥有代码

片段(jm*******@gmail.com)


谢谢,

Johnny

What do you think about writing a .Net wrapper for the Web Service and
setting a reference to it in VBA (I only need a small part of what''s
offered via this service)? Also, I would love to have the code
snippets if you''re offering (jm*******@gmail.com)

Thanks,
Johnny


这不是个坏主意,Johnny。在某种程度上,它将允许你获得两个世界中最好的
。我听说你可以编译.NET

组件并使它们可以在VB中访问。我认为在创建程序集之前,必须在Visual Studio(或命令行

编译器)中选择一些

选项。我没有这样做,所以我不是b $ b不完全熟悉它但你应该能够找到信息

就可以了。


唯一的缺点是你需要在客户端机器上安装.NET框架

,而如果你需要它就不需要它b / b
采用VB方法。


比尔

That''s not a bad idea, Johnny. To some degree, it would allow you to
get the best of both worlds. I''ve heard that you can compile your .NET
components and make them accessible in VB. I think that there are some
options that you must select in Visual Studio (or in the command line
compiler) before you create the assembly. I haven''t done this so I''m
not totally familiar with it but you should be able to find information
on it.

The only drawback is that you would need to have the .NET framework
installed on the client machines whereas you wouldn''t need it if you
went with the VB approach.

Bill


这篇关于访问VBA和Web服务(XML)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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