HTTP POST, how do I do it, help please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need send a XLM-document via HTTP-POST to another application from
my Access2003 database. Any suggestion how to do it ??????
I was hoping to to this with VBA-programming but can´t figure out how.
 
Thanks Alex,
Couldn´t really figure it out though, I´ve searched MSDN, and there was
alot! but nothin that made sense to me.

There must be some kind of easy way of doing a sinple http Post with a xml
document from Access2003, anyone??
Maybey someone has an example to share that works with access.
 
Here's an example from one of my own apps. This code requires a reference
(Tools, References in the VBA IDE) to Microsoft XML version 2.6 or later.
Look for msxml2.dll, msxml3.dll, or msxml4.dll in the Windows\System32
folder. Don't try to use this code with version 2.0 or earlier, the syntax
is different. Don't use version 5 if you plan to distribute the app to other
users. Version 5 is installed by Office 2003 and is not redistributable. I'm
not sure about version 6, it seems to be installed by SQL Server 2005, I'm
not sure whether it is redistributable or not. The latest redistributable
I've been able to find so far is this one for version 4 ...

http://www.microsoft.com/downloads/...2b-b4f2-46da-b4b6-c5d7485f2b42&displaylang=en

And here's the code ...

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

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

'You might want to change False to True in this line if
'you don't expect a response from the target
objDocument.async = False

objDocument.Load CurrentProject.Path & "\NEWB.XML"

'You can use this for testing if you want. It doesn't process or store
the XML in
'any way, it just sends back the text 'I hear you'. It's just somethign
I used during
'my own testing. Of course, I make no guarantee as to its continued
availability
'and while I personally do not look at or store any data sent to that
page, I
'accept no responsibility if anyone sends sensitive data.
objRequest.Open "POST", "http://brenreyn.brinkster.net/targetpage.asp",
False

objRequest.send objDocument.xml
MsgBox objRequest.responseText, , "Response"
 
Pelle said:
Thanks Alex,
Couldn´t really figure it out though, I´ve searched MSDN, and there
was alot! but nothin that made sense to me.

There must be some kind of easy way of doing a sinple http Post with
a xml document from Access2003, anyone??
Maybey someone has an example to share that works with access.

Dim MyURL As String
Dim oHTTPPost As Object

Set oHTTPPost = CreateObject("Microsoft.XMLHTTP")
MyURL = http://SomeMadeUpURL
oHTTPPost.Open "POST", MyURL, False
oHTTPPost.setRequestHeader "Content-Type", "text/xml"
oHTTPPost.Send(MyData)
 
Thansk alot both Rick and Brendan!!!
Looks like the thing I was looking for.
I´ll try Rick´s first.

If this works I owe you big time!!
 
Thanks Brendan,

Your code example and asp page has also helped me a great deal!

Thanks again,
Drew
 
Anybody about care to provide a tip on how to send the HTTP header AND the
data in the same packet? Explaination: Currently the header is sent first in
the first packet which is then acknowledged, then the data follows in a
second packet, which is acknowledged seperately.
 
Back
Top