Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using MSXML2.XMLHTTP OBJECT IN A FORM

Status
Not open for further replies.

RoadRunnerOz

Programmer
Aug 22, 2000
128
0
0
AU
I'm working a project to upload orders to a website.
Everything was fine while developing but when I attempted to
migrate my code to a form I got this error:
"OLE IDispatch exception code 0 from msxml3.dll. The parameter is incorrect."

and the weirdest thing is the .prg then gives me the same error until I restart VFP.
Clearing, closing, releasing etc does nothing


*-- Works as a prg but not in a method?????
USE sysfile
oHTTP = CreateObject("MSXML2.XMLHTTP")
lcUsername = ALLTRIM(sysfile.User)
lcPassword = ALLTRIM(sysfile.Pass)
lcFile = FILETOSTR("C:\Windows\Temp\x_3MA16S8GZ.XML")

lcUrl = "oHTTP.Open("POST", m.lcURL , .F., m.lcUsername, m.lcPassword)

oHTTP.setRequestHeader("Content-Type", "text/xml")
oHTTP.Send(m.lcFile) && <---- here I get the error

IF "error" $ oHTTP.responseText
=MESSAGEBOX(oHTTP.responseText)
ENDIF

And yes the temporary XML file is the same.

I originally had oHTTP as a property on the form and got the same results.
Retrieving data off the same server in different form is not an issue
oHTTP = CREATEOBJECT('MSXML2.XMLHTTP')
lcUrl = "oHTTP.OPEN("GET", m.lcUrl , .F., m.lcUsername, m.lcPassword) && YES
oHTTP.SEND("")


Thanks in advance

TheYankDownUnder

Michael Ouellette
 
Col bannanas...

That seems to be it. Thanks heaps!


Michael Ouellette
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top