Douglas Cummings
asked on
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
Can someone help me with the code needed to accomplish this task.
Thanks
Where is the PHP script located? Is it available at a URL so you can call it in the form of an API?
ASKER
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
http://VendorSite.com/DataSource.php
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.Serve rXMLHTTP")
req.Open "POST", strPage, False
req.setRequestHeader "Content-Type", "application/x-www-form-ur lencoded"
req.send strPost
MsgBox req.responseText
End Sub
Private Sub Test(strPage As String, strPost As String)
Dim req As Object 'New MSXML2.XMLHTTP30
Set req = CreateObject("MSXML2.Serve
req.Open "POST", strPage, False
req.setRequestHeader "Content-Type", "application/x-www-form-ur
req.send strPost
MsgBox req.responseText
End Sub