Send HTTP Request

  • Thread starter Thread starter Wayne Stobbs
  • Start date Start date
W

Wayne Stobbs

Can anyone advice how I, as a dummy, can sent an HTTP
request from Access 2000

I want to have a button on my form which will send an SMS
to a user. I already have a working URL to send to (I use
it currently from a Server Monitor Application) and I just
want to send a string to the URL

Any Guro out there who can help this dummy?
 
Wayne Stobbs said:
Can anyone advice how I, as a dummy, can sent an HTTP
request from Access 2000

I want to have a button on my form which will send an SMS
to a user. I already have a working URL to send to (I use
it currently from a Server Monitor Application) and I just
want to send a string to the URL

Any Guro out there who can help this dummy?

Dim oHttpRequest As Object
Dim POSTData as String

Set oHttpRequest = CreateObject("Microsoft.XMLHTTP")
POSTData = "your data"
oHttpRequest .Open "POST", "Your URL String", False
oHttpRequest .Send (POSTData)
 
I have a similar need... I need to submit form values to a web based form...

How would I go about entering the values, the html form that submits the
data usually has 2 fields pcode1 and pcode2, how would i reference these as
form variables? I would put this is the POST data from the code you
supplied??

-----

I have a second problem, but would be happy with just the first one being
answered!!!

Once the form data has been submitted, how would I grab (parse) the text
produced and get the text between the end of a particular sentance and the
beginning of another?? I can do this in CF, but have no idea how in
MSAccess!!!

Many thanks,


Mark.
 
Mark Stephenson said:
I have a similar need... I need to submit form values to a web based form...

How would I go about entering the values, the html form that submits the
data usually has 2 fields pcode1 and pcode2, how would i reference these as
form variables? I would put this is the POST data from the code you
supplied??

Normally you wouldn't. A web form when "submitted" sends a POST request
to some other URL. If you do the POST request from Access then the web
form is not needed at all. You just send the request to the same URL that
the web form would.
I have a second problem, but would be happy with just the first one being
answered!!!

Once the form data has been submitted, how would I grab (parse) the text
produced and get the text between the end of a particular sentance and the
beginning of another?? I can do this in CF, but have no idea how in
MSAccess!!!

The HTTPRequest POST should return back whatever the web service that
processed the POST is set up to send back. It would be in the responseText
property of the requestobject.
 
Perhaps I am asking the wrong questions???

Dim oHttpRequest As Object
Dim POSTData as String

Set oHttpRequest = CreateObject("Microsoft.XMLHTTP")
POSTData = "your data"
oHttpRequest .Open "POST", "Your URL String", False
oHttpRequest .Send (POSTData)

-------

In POSTDate = "your data", is this where I would supply the variable data?

i.e;

POSTData = "Form.Pcode1='TS190at';Form.Pcode2='TSblah'"

How do you correctly reference the form variables??

Many thanks,


Mark.
 
Mark Stephenson said:
Perhaps I am asking the wrong questions???

Dim oHttpRequest As Object
Dim POSTData as String

Set oHttpRequest = CreateObject("Microsoft.XMLHTTP")
POSTData = "your data"
oHttpRequest .Open "POST", "Your URL String", False
oHttpRequest .Send (POSTData)

-------

In POSTDate = "your data", is this where I would supply the variable data?
Yes.

POSTData = "Form.Pcode1='TS190at';Form.Pcode2='TSblah'"

How do you correctly reference the form variables??

As previously stated I don't think you would be "referencing a form". Typically
a web form is filled out and then a [Submit] button on the form is pressed which
causes that page to send a POST request to some other page or web service
program. If you are sending the POST request from Access then you send the data
directly to the final page or web service program. There is no need for a web
form because Access is doing the job that the web form would ordinarily be
doing.

A typical URL encoded data string would look like...

Variable1=SomeValue&Variable2=SomeOtherValue&etc..
 
Back
Top