'Option Strict On disallows late binding' problem

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am trying to create a Microsoft.XMLHTTP object via below code;

Dim oHttpPost As Object
oHttpPost = CreateObject("Microsoft.XMLHTTP")
oHttpPost.Open("POST", "www.myurl.com", False)

The problem is that I am getting an error on the statement oHttpPost.Open.
What type of variable do I need to declare oHttpPost as?

Thanks

Regards
 
John said:
I am trying to create a Microsoft.XMLHTTP object via below code;

Dim oHttpPost As Object
oHttpPost = CreateObject("Microsoft.XMLHTTP")
oHttpPost.Open("POST", "www.myurl.com", False)

The problem is that I am getting an error on the statement oHttpPost.Open.
What type of variable do I need to declare oHttpPost as?

Either disable 'Option Strict' for the file to allow late binding or add a
reference to the MSXML COM library, import the required namespaces and use
the classes defined in the namespaces.
 
Hi Herfried

Thanks for this. I have several references to XML;

Microsoft XML, v2.6
Microsoft XML, v3.0
Microsoft XML, v5.0
Microsoft XML, v6.0
Microsoft XML, version 2.0

Does it matter which one to use?

Thanks

Regards
 
It would make more sense to me, if you are doing this in .Net, to use the
System.Net.HttpWebRequest class, rather than using the older COM version. It
should provide equivalent methods for everything you might need to do.

By the way, for most ordinary XML, it doesn't make any difference which version
of MS-XML you use. Using an older one ensures a wider range of compatibility.
 
Back
Top