Retrieving an Array Returned from PHP

buckibooster

Registered User.
Local time
Today, 03:44
Joined
Dec 16, 2013
Messages
10
I have an Access Database that I will be using on a desktop. I have a table in this database that mirrors the structure of a table on a remote server in a SQL database. I have successfully created a vba function within the Access database that uses a server-side php subroutine to select records (I usually won't know how many) from the SQL database and return them to the access database. The code I use in the access vba subroutine to access the php subroutine is:

Code:
With CreateObject("Shell.Application").Windows
        Set ieWindow = CreateObject("InternetExplorer.Application")
        ieWindow.Visible = False
        apiShowWindow ieWindow.hwnd, SW_MAXIMIZE
        ieWindow.Navigate "Web address for server-side php file"
End With

The last command in my php subroutine is "return $retrievedData." $retrievedData is a multidimensional array containing data from 42 fields in multiple records (again, I usually won't know how many). I've checked the data in php so I know it has been stored correctly. My question for the experts reading this posting is how do I access the returned data within my access vba subroutine?

I should add that my overall reason for doing it this way is that I want to maintain my server-side database as an untouched master. Users can only add data to it. My client-side database is used to update the input table and further process the data. The subroutines described above are intended to retrieve "new" records only (i.e., records posted since the last access database update) from the server-side database and transfer them to the access database for further processing.
 
Last edited:
Not like that. You are launching a new window and the moment you do that it is largely bye bye to any interaction.

One of the viable paths is here: http://www.access-programmers.co.uk/forums/showthread.php?t=176968 and then you have to extract the table, by using your knowledge of the DOM .

Google VBA get table from HTML

A hybrid solution could be to use excel, since in excel you can easily link to a web-based table - try it.
 
Thank you for your help spikepl. I've pretty much got it licked now.
 
Seems very roundabout. I would use an ADODB command object to return a recordset direclty from the server.

SQL Server has very fine grained permissions.

If you continue to do what you are doing you had better be closing the hidden IE windows.
 

Users who are viewing this thread

Back
Top Bottom