1

Platform: Windows 7 Professional Web Server: WAMP 2.1

I'm currently on the process of building a site that can generate reports using php. I already have reports in my MS Access and I wanted to use it for me to save time instead of creating again with the same report in other reporting tools. Now, I'm using this code: shell_exec("\"C:\\Program Files (x86)\\Microsoft Office\\Office12\\msaccess.exe\" \"E:\\central\\projapps\\HSSE\\hsse.mdb\" /X \"HSSE TRAINING STATISTIC\"");

  1. First Setup:

    • WAMP server is down,
    • httpd.exe is running as console application, a black window(cmd prompt-like)
    • the above code will generate my report and viewed in MS Access
    • but the whole website can't be viewed as it should be
  2. Second Setup:

    • WAMP server in up
    • httpd.exe is not running as console application
    • the above code will not generate my report
    • whole website will run perfectly

On the second setup, Interactive Services Detection will come-up. Hope I deliver myself clearly 'coz I really need this badly. Thank in advance and you all have a great day.

  • PHP can read MSAccess databases via an ODBC database driver. [This](http://stackoverflow.com/questions/6328554/what-will-be-connection-string-to-access-database-file-with-php) and [this](http://stackoverflow.com/questions/1605473/php-and-microsoft-access-database-connection-and-crud) questions may help you. – SDC Oct 31 '12 at 13:09

1 Answers1

0

You can't use Access in web development as a reporting tool unless you jump through a pile of hoops to get there. This is because Access is designed to be a desktop application for the most part. You could follow a "Not recommended" path with these steps.

  1. Create a sub or function that runs when the Access file is shelled that takes an argument to determine which report to run.
  2. Export the report to HTML
  3. Point to this HTML file from your website.

Most likely it won't be worth the effort to go this route. I think it would be best to just rewrite the reports in a web reporting tool.

HelloW
  • 1,587
  • 2
  • 13
  • 24
  • Ok, maybe I just can't make the window of MS Access pops-up, can you help me how can I convert MS Access report be saved-as PDF format using com objects of php?you know, using new com("msaccess.application"); – romel gomez Nov 01 '12 at 04:30
  • I think I would try something from this page to get started. http://php.net/manual/en/ref.com.php – HelloW Nov 02 '12 at 18:55