views:

156

answers:

1

I am getting daily data dump via e-mail, which is being processed by Access (based on the Outlook rule, VBA is extracting the attachment and running Access procedures, so I get a report).

As data dump is getting bigger and bigger, and having in mind that Access is run locally which consumes my resources, I want to set up a PHP/MySQL server to make it more efficient.

The first challenge I face is how to connect Outlook rule with PHP execution? (as I will have Outlook set up on the Windows based machine, with apache/mysql set up (WAMP))

Anyone can share some insights on how to start PHP execution from Outlook?

Thanks for the help!

Srdjan

+1  A: 

If you have an existing setup using Access and VBA, and you just need a better database behind it, could you not just use MySQL without PHP and use the MySQL ODBC driver instead of the Access connection you are using at the moment (assuming you are currently using ODBC to connect to the access database)

This way you wouldn't even have to have mysql running locally if the hit is too high on your local machine and it should be pretty straightforward in that you shouldn't have to make to many changes to your vba code.

Of course, whether this will do it depends on what else is going on in your access db

If not you could try using php and using the PHP Command Line Interface (CLI) which you should be able to call as an external executable from Outlook. Just pass php.exe the name of the php script you want to run

UPDATE:

I am not a VBA expert by any means but it looks like the shell function would let you run the PHP CLI from within VBA

Shell("path/to/php.exe phpscript.php")

http://msdn.microsoft.com/en-us/library/xe736fyk(VS.71).aspx

Of course this will only work if you can get to php.exe on the wamp machine (ie is a local machine or you have network access to the appropriate folder)

Alternatively, if the Wamp server is to be a separate machine then you could trigger the php script to be run by calling a url. I think the XMLHTTP object will do this for you

Dim xmh As Object

Set xmh = CreateObject("MSXML2.XMLHTTP") 
xmh.Open "GET", "http://urlofphpserver/script.php", False
xmh.Send 
Addsy
+1 this says all I wanted to say too. Damn your quick typing fingers! :)
Pekka
haha, cheers! ;)
Addsy
Thanks for the help, will test it!I wanted to skip access and transfer all tables/queries to MySQL, and macro/VBA to PHP, as it is consuming too much of computer resources. As there needs to be several access instances run at the same time, I figured it is better to use PHP/MySQL combo, as it is lighter and can process it faster.Thanks for the help!
Srdjan Mirosavljevic