View Full Version : Help with MSXML2.ServerXMLHTTP

09-27-2005, 10:52 PM
Currently when a customer wants to sign-up with the company I work for, there is a site an administrator goes to, to check to see if they show up on a certain report. I was able to automate this process for another site we use and it works beautifully. Unfortunatley, this site I'm trying to do it with now doesn't seem to want to cooperate. It just comes back as a blank page.

This is the form I'm trying to access:


This is the code I am using to post to the page that form posts to:

Dim oXMLHTTP, sResponse
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.Open "POST", "http://epls.arnet.gov/epls/servlet/EPLSGetInputSearch", False
oXMLHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.Send "" & _
"pen=ANY" &_

sResponse = oXMLHTTP.ResponseText
sOriginalResponse = sResponse
Set oXMLHTTP = Nothing

First off is there anything wrong with doing this? It worked like a charm for the other site they use for customer verification. Secondly, why isn't this working. I'm guessing it has something to do with the submit button having to be actually clicked, but I'm passing it too. :confused:


09-28-2005, 02:36 PM
You don't have the ampersand to separate form data.

oXMLHTTP.Send "" & _
"option=2&" &_
"button=OK&" &_
"name1=adams&" &_
"pen=ANY&" &_
You might have been confused with the & operator.

09-28-2005, 06:31 PM
Yep, I ended up figuring it out, that was exactly the problem. I also needed to specify the length of the form string as well.

oXMLHttp.setRequestHeader "Content-Length", Len(sQuery)