In the application of the XMLHTTP component writing program, you will encounter the "Msxml3.dll error ' 800c0005 ' system did not find the specified resource. "This kind of mistake, the network to this kind of mistake reason has many clock explanation, basically is because the firewall or the UDP station Port Authority caused, also said the corresponding solution." Other times are not necessarily. In fact, the main reason for the wrong description is "the system does not find the specified resource." This error occurs when the open method that invokes the XMLHTTP component is invoked, followed by the Send method. When the URL parameter of the open method is inaccessible, a 8000005 error is caused. And once this error occurs, the application terminates and cannot continue. Most of the programs that are said are written like this:
Function functionname (Pararm ...)
Dim Http
Set http=server.createobject ("MSXML2. xmlhttp.4.0 ")
With Http
. Open "Get", Httpurl,false
. Send
End With
If Http.readystate<>4 Then
Set http=nothing
......
Exit function
End If
End Function
Most programs use the XMLHTTP Readystate attribute to determine the return status from the server. In fact, this may not be appropriate, many times with the readystate attribute to judge and can not really detect errors in the program process. When the error is encountered, the program will still be terminated. In fact, modify the above code, you can completely skip the execution of the program encountered errors, so that the program continues to run. Modify the code as follows:
Function functionname (Pararm ...)
Dim Http
Set http=server.createobject ("MSXML2. xmlhttp.4.0 ")
With Http
. Open "Get", Httpurl,false
. Send
End With
On Error Resume Next
If http.status<>200 Then
Set http=nothing
......
Exit function
End If
End Function
When the Send method produces an error, the value of the readystate may be 4, but the return value of the status must not be 200. Hehe, I have been tracking readystate and status for many times before the results are worthwhile. There may be a mistake and I haven't found it yet.
Hope that the above program solution can help you!! If you have a better solution for your friend, please tell me yo.
I am an example of a program described in msxml2.xmlhttp.4.0 and also suitable for other versions of the XMLHTTP component. To check which versions of the XMLHTTP components are already installed in your system, go to the HKEY_CLASSES_ROOT under the registry to find them.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.