• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1471
  • Last Modified:

Capture Data From a PHP Script From Within MS Access VBA

I would like to execute a PHP script from with Access VBA and capture the data that is generated into a variable.

Can someone help me with the code needed to accomplish this task.

Thanks
0
dwcummings
Asked:
dwcummings
  • 2
1 Solution
 
Ray PaseurCommented:
Where is the PHP script located?  Is it available at a URL so you can call it in the form of an API?
0
 
dwcummingsAuthor Commented:
It is located on a website. I cannot post the URL due to licensing restrictions from the vendor. But essentially, it is something like the following:

http://VendorSite.com/DataSource.php
0
 
CodeCruiserCommented:
0
 
dwcummingsAuthor Commented:
Thanks for the link and the help. Below is the code that I extrapolated from the site and used in my application:

Private Sub Test(strPage As String, strPost As String)

    Dim req As Object 'New MSXML2.XMLHTTP30
    Set req = CreateObject("MSXML2.ServerXMLHTTP")
   
    req.Open "POST", strPage, False
    req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    req.send strPost
   
    MsgBox req.responseText

End Sub
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now