简体   繁体   English

PHP的COM对象的MSAccess

[英]php com objects msaccess

Platform: Windows 7 Professional Web Server: WAMP 2.1 平台:Windows 7 Professional Web服务器:WAMP 2.1

I'm currently on the process of building a site that can generate reports using php. 我目前正在建立一个可以使用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. 我的MS Access中已经有报告,我想使用它来节省时间,而不是在其他报告工具中再次使用相同的报告进行创建。 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\\""); 现在,我正在使用以下代码: 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, WAMP服务器已关闭,
    • httpd.exe is running as console application, a black window(cmd prompt-like) httpd.exe作为控制台应用程序运行,黑色窗口(类似于cmd提示符)
    • the above code will generate my report and viewed in MS Access 上面的代码将生成我的报告并在MS Access中查看
    • but the whole website can't be viewed as it should be 但是整个网站无法正常显示
  2. Second Setup: 二次设置:

    • WAMP server in up WAMP服务器启动
    • httpd.exe is not running as console application httpd.exe没有作为控制台应用程序运行
    • the above code will not generate my report 上面的代码不会生成我的报告
    • whole website will run perfectly 整个网站将完美运行

On the second setup, Interactive Services Detection will come-up. 在第二种设置中,将显示Interactive Services Detection。 Hope I deliver myself clearly 'coz I really need this badly. 希望我能清楚地表达自己,因为我真的很需要这个。 Thank in advance and you all have a great day. 在此先感谢您,祝您度过愉快的一天。

You can't use Access in web development as a reporting tool unless you jump through a pile of hoops to get there. 在Web开发中,不能将Access用作报告工具,除非您跳入一堆圈。 This is because Access is designed to be a desktop application for the most part. 这是因为Access在很大程度上被设计为桌面应用程序。 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. 创建一个子程序或函数,该子程序或函数在带壳的Access文件中运行,并带有一个参数来确定要运行哪个报告。
  2. Export the report to HTML 将报告导出为HTML
  3. Point to this HTML file from your website. 从您的网站指向此HTML文件。

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. 我认为最好只在Web报告工具中重写报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM