Pitching SQL Spitballs

Mar 18

Pitching SQL Spitballs

Some time ago, my company was maintaining information in an Access database that we also wanted to use as Web content. We were on a Windows host at the time, so we just FTPed the database up to the server every day. A little kludgy, but it worked well.

Then we switched to a Linux host behind a strict firewall (so no replication or remote access). What to do?

What I ended up doing was creating a macro (written in VBA) in Access that would “throw” a record from any table at a page on the Web server. That page was a “catcher” that would process what was thrown at it, and write it to the same table in a MySQL database.

It’s generalized — so long as a duplicate table exists in MySQL, it will transfer data from any Access table. It also allows for data-scrubbing: you can run user-defined functions on field values coming in from Access before putting them in MySQL (handy for date conversions).

What was handy about this is that you got all the client-side functionality of Access (I built some great user forms to manage the content), but all the data made its way out to the Web server to be used on the Web site. It was kinda the best of both worlds.

I’ve moved on to something else now, but this code was really handy and worked really, really well. It never failed once, as a matter of fact. I don’t want this to go to waste, so I’m posting it here. Here are:

The Pitcher (a VBA BAS file — you can view this in a text editor)
The Catcher (a PHP page)

I’ve commented them quite a bit, so you should be able to figure them out. But if you have questions, drop me a line. Looking back over it, I realize that I never wrote it for anyone else to look at it, so there may be crap in there that doesn’t make sense.


Comments

by Rob,   March 18, 2004 10:30 AM  

Let me get this straight. Crap in your code that doesn't make sense. I'm shocked. :)



Add Comment


Want to advertise on this site? Contact FM.
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!