Forum Academy Marketplace Showcase Pricing Features

MS Access connecting via API (using VBA)

Looking for the best method to send data to and from a MS Access database (linked to SQL server). Have been trying the Microsoft XML 6.0 object library without success. Is there a better method such as calls from SQL server?

This is a simple method for getting data out of

Public Function GetVehicleData()
Dim pHtml As String, strResponse As String, strFilter
strResponse = ""
    pHtml = "[APIKEY]"

    Dim oHttp As Object
    Set oHttp = CreateObject("Microsoft.XMLHTTP")
    Call oHttp.Open("GET", pHtml, False)
    oHttp.setRequestHeader "pragma", "no-cache"
    oHttp.setRequestHeader "cache-control", "no-cache"
    oHttp.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
    oHttp.setRequestHeader "Content-Type", "application/json"
    strResponse = oHttp.responseText
    Set oHttp = Nothing
    Debug.Print strResponse 'Response needs to be parsed'
End Function