Articles

Access, PHP, and MySQL

Please consider supporting this site by purchasing items from the Book Store. Thanks for visiting!

There are times when I would love to enter data into an MS Access database on my local machine, and then pass that data to a MySQL database on a web site. However, firewall rules normally prevent accessing those databases from outside the network where the respective server machines are located.

How can I get around this?

In researching this question, one reasonably simple answer is to have a small slave program on the website that hosts the MySQL database. Your MS Access database then passes the data to this slave, which then adds the data to the database on the internet.

Specifically, the approach I took is this.

  • enter data into MS Access database on local machine
  • Access exports data to a text file (or you could get fancy and do XML output)
  • Access initiates an FTP command which transfer the text file to the website
  • Access initiates the slave program on the website
  • slave program reads the uploaded text file and inserts data into the MySQL database
  • text file is deleted from the website

The slave program is created using PHP.

Next posting will start a series that will give more details. In the meantime, you may want to play with this idea on your own and then compare with my solution later.

This posting also exists as an article on the main site. See it here.

2 More Lost Articles

I am sure that I have found them all now.

Seems that when I moved from AccessDatabaseTips.com over to DatabaseLessons.com I moved some files and never added them to the index pages. Most were discovered a month or so ago. Found 2 more today.

Need to use a query to change UPPER CASE values in a field to Mixed Case? Try this.

The documentation tool that comes with Access 2000 (under Tools, Analyze, Documentor) is VERY slow compared to the Access 97 version. I do not understand why. I use this feature frequently to print out the field names of a table. It is so slow in MS Access 2000 that I designed my own. Here is its story!

While I was at it, the info on “dao” was linked to from dozens of articles, but it was never added to an index page. It is now on the “Modules” page.

NOTE: All the VBA code segments on the Database Lessons site assume that you have DAO references active. If you are not sure what this means, and you are using Microsoft Access 2000 or higher, click here.

I hope your databases are being good to you!

Report Criteria – Part 2

I have done a major rewrite of this article, first published many moons ago. The new version has 4 screen shots (about 60 K in total), to help you visualize what I am suggesting. I think I explain myself better as well.

If you have dozens of reports that need various criteria fields, then between this new version and the original Part 1 of this series, you should have a workable answer.

Read the article by clicking here.

As always, write me with further ideas or questions about this article.

Calendar Series Part 4

A reader reminded me that I never posted part 4 of the Calendar series. Here it is at Calendar Form – Part 4.

Lost Articles

I discovered about 20 articles that were on the web site, but not linked to from any of the menu pages. I have updated the menu pages, and Tables, Queries, Forms, and Reports all have new articles. Most went on the Forms page.