Import Select SQL Records from a Remote Server to a Access



I have an existing SQL database set up on a remote server. I want to import select records from a single table within this SQL database to an Access (2010) database table running on my desktop. I know how to get the records I want from the SQL database using a "SELECT FROM ..." command within a php subroutine but how do I get this data into my Access Database running on my desktop? Can I execute this php file from within Access running on my desktop and get the data directly into my desktop as a "GET" array which I can then manipulate on my desktop?

This is probably an MS Access question rather than php.

You are right, php can retrieve records from a remote database. Theoretically, your code could write the records to another database including Access. HOWEVER:

1) The php server needs to be able to read/write the Access database and if that is on your desktop, then it will depend on where PHP is running and the permissions to get to your desktop. IHMO there may be security issues with this setup.

2) Alternatively you could use MS Access to read the remote database directly. Linked tables to remote databases are something Access does really well, and you can then write VBA code or a few append queries to move the data. (Access rocks as a ETL tool!)

3) If not used later versions of Access very much, but even in earlier versions, you could execute a url and retrieve the results, so you could try writing a php page that retrieves data from the remote database and passes the results to the caller (in this case Access). I've done this a long time ago with xml.

Of these, #2 is the easiest.

Hope that helps