• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1554
  • 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.

  • 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?
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:

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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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