Uploading XML file to web server via http in Access

  • Thread starter Thread starter Veronica Bourke via AccessMonster.com
  • Start date Start date
V

Veronica Bourke via AccessMonster.com

Hi there,

I was just wondering if anyone could help me. I cant seem to find a
straight forward example of how to upload an xml file to a webserver using
http protocol. If anyone had a clear step-by-step example i'd be very
grateful.

Thanks a million in advance
 
I'm afraid in my experience the process is not always very straight forward
because of confusing differences in behaviour between different versions of
the MSXML DLL. Code similar to the following should work with most recent
versions, but I found that with some versions of the DLL I had to change
'objRequest.send objDocument' to 'objRequest.send objDocument.XML'. With
other versions, that wouldn't work and I had to take the '.XML' out again.
This code requires a reference to Microsoft XML (MSXML.DLL). V4 seems to be
the latest re-distributable version, there's a V5, which is installed by
Office 2003 (and I think SQL Server 2005) but that version doesn't appear to
be redistributable.

Dim objRequest As MSXML2.XMLHTTP
Dim objDocument As MSXML2.DOMDocument

Set objRequest = New MSXML2.XMLHTTP
Set objDocument = New MSXML2.DOMDocument

objDocument.async = False
objDocument.Load "path and name of XML file here"
objRequest.Open "POST", "URL to which to post here", False
objRequest.send objDocument
 
Thanks a million for your help. In the mean time i actually came across the
MSXML2 library and after much trial and error managed to get it working.

I had originally tried the Inet lib but later found out that while you can
upload and download files with the icFTP you can only download files using
icHTTP.

I got there in the end though.

Thanks again.
 
Back
Top