BUG: Error Message When onreadystatechange Used with XML HTTP Objects in Visual Basic (303322)
The information in this article applies to:
- Microsoft XML 2.0
- Microsoft XML 2.5
- Microsoft XML 2.6
- Microsoft XML 3.0
- Microsoft XML 3.0 SP1
- Microsoft XML 4.0
This article was previously published under Q303322 SYMPTOMS
When you attempt to set the onreadystatechange property of the XMLHTTP object within Microsoft Visual Basic to a function or variable, you may receive the following error message:
Run-time error '424':
Object Required
CAUSE
The onreadystatechange property is designed for use in scripting environments and is not readily accessible in Microsoft Visual Basic or Microsoft Visual C++. Note that this problem and its accompanying workarounds also apply to the ServerXMLHTTP object.
RESOLUTION
To work around this problem, do one of the following:
- Poll the readystate property by using a timer. When the data is ready, turn the timer off.
- Use DOMDocument to load the XML data and handle the state by using the withevents keyword. Note that if you are using XMLHTTP to post the data first, this resolution does not work.
- Create a wrapper class and create a procedure to handle the event, then set the procedure to be the default and bind the class to the onreadystatechange XMLHTTP event.
STATUSREFERENCES
For the latest information and downloads for the Microsoft XML parser, see the following Microsoft Developer Network (MSDN) Web sites:
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
278674 Determine the Version of MSXML Parser Installed on a Computer
Modification Type: | Major | Last Reviewed: | 9/25/2001 |
---|
Keywords: | kbbug kbDSupport KB303322 |
---|
|