msxml3.dll 错误 '80072efd' A connection with the server could not be established
最近两个月以来,有一个站点的登录程序每隔3至5天,程序就报错:
msxml3.dll 错误 '80072efd'
A connection with the server could not be established
相应的代码如下:
dim url
url = "http://www.baidu.com/abc/"
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url + "?" + data, False
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
xmlhttp.setRequestHeader "Content-Length", Len(data)
xmlhttp.send (Null) '在这一行报错
If (xmlhttp.Status = 200) Then
httpGet = xmlhttp.responseText
else
httpGet = ""
end if
Set xmlhttp = Nothing
关于这个错误,前段时间也在百度、google搜索过,没有找到可以解决这个问题的答案。
今天又报错了,郁闷,但我意外试了另一个站点使用相同程序却可以正常登录。
我仔细一看,原来他们有所不同,出问题的程序是:xmlhttp.open "POST", url + "?" + data, False
那另一个站点使用的是:xmlhttp.open "GET", url + "?" + data, False
我把出问题的这个站点中的POST改为GET后,竟然也可以正常登录了。
难道与这个有关?那为什么POST平时也能使用,但几天后就不行了呢,改为GET又可以了...
-----------------------------------------------------------------------------------------
最近几天,问题依然存在,我发现同一台主机有些虚拟站点同样调用MSXML2.ServerXMLHTTP,但不会报错,但有的虚拟站点却报:
msxml3.dll 错误 '80072efd'
A connection with the server could not be established
我刚刚回收了一下IIS的[应用程序池],然后试着执行了: regsvr32 msxml3.dll
过了几秒后,竟然原来报错的虚拟站点自动恢复正常了。
以前一般都是重启IIS,还不行,就重启主机。
我不知道是我回收了IIS的[应用程序池]还是regsvr32 msxml3.dll,解决了这个问题,
-----------------------------------------------------------------------------------------
[网上邻居] -> [本地连接] -> [修复] 一下,几秒后就恢复正常了。。。