【问题标题】:Perform hidden http-request from vba从 vba 执行隐藏的 http 请求
【发布时间】:2011-11-07 10:32:30
【问题描述】:

我想执行来自 MS-access 的隐藏 HTTP-GET 请求, 尽可能简单,没有任何额外的库/组件。

只需一个简单的声明即可。

WinHttp 离开大楼了吗??

【问题讨论】:

标签: ms-access vba dll


【解决方案1】:

这里有一个great page 关于那个。

【讨论】:

    【解决方案2】:

    希望对你有帮助

     Dim xhr As Object
     Dim webServiceURL As String
     Dim actionType As String
     Dim thisRequest As String
     Dim targetWord As String
    
     WebServiceURL = "http://services.aonaware.com/DictService/DictService.asmx/"
     actionType = "Define?word="
     targetWord = "Marketplace"
     thisRequest = webServiceURL & actionType & targetWord
    
     'use late binding
     Set xhr = CreateObject("Microsoft.XMLHTTP")  
    
     xhr.Open "GET", thisRequest, False
     xhr.Send
    
     If xhr.status = 200 Then
       Debug.Print xhr.responseText
       MsgBox xhr.getAllResponseHeaders
     Else
       MsgBox xhr.status & ": " & xhr.statusText
     End If
    
     Set xhr = Nothing
    

    【讨论】:

      猜你喜欢
      • 2021-03-24
      • 2011-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-07
      • 2017-10-25
      相关资源
      最近更新 更多