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
LVL 3
dwcummingsAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
0
 
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
 
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
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.

All Courses

From novice to tech pro — start learning today.