在 Microsoft Access 中使用 VBA,我将 XML 发送到服务器以获取响应字符串。它在 Windows 7 中运行良好。最近,一些用户已经升级到 Windows 10,这不再适用(Office 16 上的所有用户)。具体错误是:-2147012867 - 无法建立与服务器的连接。
错误发生在 xsite.send 行
这是代码:
Dim xsite As ServerXMLHTTP60
Set xsite = New ServerXMLHTTP60
On Error Resume Next
xsite.setTimeouts 0, 60000, 30000, 600000
xsite.Open "POST", pServerURL & func, False
aErr = Array(Err.Number, Err.Description)
On Error GoTo 0
If 0 = aErr(0) Then 'No error creating the link
xsite.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Set request header with Base64-encoded username/password
xsite.setRequestHeader "Authorization", "Basic " & EncodeBase64(UserName & ":" & Password)
On Error Resume Next
xsite.send "xmlData=" & URLEncode(xmldata)
aErr = Array(Err.Number, Err.Description)
On Error GoTo 0
Debug.Print aErr(0)
Debug.Print aErr(1)
End If
有任何想法吗?