472,328 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Access VBA and Web Services (XML)

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

Nov 13 '05 #1
12 3375
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

Nov 13 '05 #2
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

Nov 13 '05 #3
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

Nov 13 '05 #4
Bill,

I'm going to search for KB,etc. documents on this. Thanks for your
opinions.

All,

Any readers out there done this before? Do you have any
advice/documentations.

Thanks everyone,
Johnny

Nov 13 '05 #5
Johnny,

A little bit of follow-up information...

To compile your VB.NET component as a com component that can be used
with VB, you would go into the VS.NET project properties under
Configuration/Build and
turn on "Register for COM interop".

Bill

Nov 13 '05 #6
rkc
Johnny Meredith wrote:
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)


There is a tool for the VBA IDE that builds proxy classes for
web services as well as doing other helpful things.

<split url>
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnxpwst/html/odc_ofwsrt.asp
</split url>
Nov 13 '05 #7
"Johnny Meredith" <jm*******@gmail.com> wrote
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.)


I think, if you explore a little at http://www.mcwtech.com/2004/webcasts,
you'll find this covered in a webcast by Ken Getz and/or Paul Litwin. I am
sure there is coverage in the current edition of their _Access Cookbook_
book. I know Ken's advice is: don't rely on any free Web Service being there
for your business application -- use one you wrote yourself or one that you
pay for.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #8
"Johnny Meredith" <jm*******@gmail.com> wrote
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.)


I think, if you explore a little at http://www.mcwtech.com/2004/webcasts,
you'll find this covered in a webcast by Ken Getz and/or Paul Litwin. I am
sure there is coverage in the current edition of their _Access Cookbook_
book. I know Ken's advice is: don't rely on any free Web Service being there
for your business application -- use one you wrote yourself or one that you
pay for.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #9
Bill,

I think I'm going to go the .Net wrapper route. It has been a very
very simple process so far.

I tried using the Web Services Toolkit, but there are a couple of
things I could not figure out:

The web service has a license key of course. In .Net, passing this key
goes like this:

Dim licensekeystruct as New SILicenseInfo
licensekeystruct.licensekey = "xyz"

Dim ws as new HistroicalQuotes
ws.LicneseInfo = licensekeystruct

With VBA, the SILicenseInfo struct was generated when the proxy classes
were built. I've seen some code that uses the SOAP header to input the
license key, but I'm not sure that applies in this situation. Am I
missing something?

Also, one particular struct has a "Date" and an "Open" member. These
words are reserved in VBA. So, the code automatically generated does
not compile until I do something with those two names. I tried
brackets "[" but that didn't work. Have you ran into this before?

These questions are more food-for-thought than anything, as I will
probably use the .Net wrapper approach. Thanks for the help.

Johnny

Nov 13 '05 #10
Correction:
<With VBA, the SILicenseInfo struct was > NOT <generated when the proxy
classes

Nov 13 '05 #11
Johnny,

I'm afraid that I can't shed any light on this. By the way, which web
service are you using?

Bill

Nov 13 '05 #12
StrikeIron Historical Quotes (www.strikeiron.com, search for historical
quotes, comes right up)

Nov 13 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anand Natrajan | last post by:
Hi! I have a VB .NET client that is accessing an rpc/encoded service deployed in Axis 1.2. One of the operations, whoami, returns a string array....
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL...
3
by: Bruce | last post by:
I am building a WinForms app that uses Web Services access to a server for most of its data input/output, but I also need to persist some of its...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create...
1
by: Bob Alston | last post by:
Anyone know of any features of the new Access 2007 that will improve on the ability of Access to work in a web environment??? Bob
9
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods...
1
by: gihan | last post by:
Hi, I have a problem accessing remote webservice from my asp code. Instead of returning results, it returns list of web methods it has. Wonder...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.