Archives: 'Development'

Linking Access to a MySQL database

Saturday, May 27th, 2006

For some time I was using Access to store and manage some simple data for a web site. Unfortunately, due to a change in hosting provider I was not able to continue using the Access database and had to migrate it to MySQL. One thing I wanted was to keep the Access forms I’d created for updating the data in the database and to create an external link in Access to the MySQL database through MyODBC. Creating the external link wasn’t a problem but there were a few gotchas that I discovered along the way to getting the forms working correctly.

Continue reading “Linking Access to a MySQL database” »

PHP – Writing to an Access .MDB database using a DSN-less connection.

Sunday, April 30th, 2006

Hot on the heels of the last article on READing data from an MS Access .MDB database file comes the eagerly anticipated sequel: “Writing to an MS Access .MDB database using a DSN-less connection.”

What a snappy title! 🙂

Here goes then. You will of course remember from the last lesson how to make the DSN-less connection to the database. No? Well here is a refresher:

//Set up the connection
if (!$conn = new COM(“ADODB.Connection”))
exit(“Unable to create an ADODB connection”);
$strConn = “DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=” . realpath(“mydatabase.mdb”);
$conn->open($strConn);

Continue reading “PHP – Writing to an Access .MDB database using a DSN-less connection.” »

PHP – Reading an Access .MDB database using a DSN-less connection.

Saturday, April 29th, 2006

So, you wanted to create a bit of dynamic content on your web site but you were too cheap to pay for that hosting package with the free databases were you? Well you’re in good company then!

Here I’ll show you how to read from an Access .MDB file when running on a Windows host web server using PHP.

Firstly here is a bit of code to get you started:

// Set up the connection
if (!$conn = new COM(“ADODB.Connection”))
exit(“Unable to create an ADODB connection”);
$strConn = “DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=” . realpath(“mydatabase.mdb”);
$conn->open($strConn);

Continue reading “PHP – Reading an Access .MDB database using a DSN-less connection.” »