dongsui8162 2014-08-15 14:52
浏览 18

PHP:远程连接到MS Access 2013

I have a client who needs us to insert contact form records into their Access 2013 database, which is hosted locally in their offices, which has a static IP address. The database file is shared on a network drive between all employees.

I know this is possible, I just don't know the most simplistic way to go about it. So, my question is: What is the least painful way to make this database connection?

I would also prefer to not setup their networked drive as a networked drive on our server to keep their drive secure. I think that the best way would be to connect through a computer on their network, then access the shared database through there.

  • 写回答

1条回答 默认 最新

  • doushi9856 2014-08-29 23:44
    关注

    You do not connect to a power-point file, you open it.

    You do not connect to a word file, you open it.

    You do not connect to a text file, you open it.

    And wonders of wonders, just like the rest of office, the same applies to an accDB file sitting in some folder. You NEVER connect to a windows file, you need rights + permissions to open that file. In fact you need the WINDOWS networking system to open such a file.

    The goal here is you need read + write permission to that windows file on the windows computer.

    You cannot connect to one computer to open a file on another. (unless you adopting something like remote desktop – but that that is a 100% different question).

    So you DO NOT make some database connection, and you CAN NOT make some database connection.

    You MUST HAVE the ability to open the file, and the technology layer MUST be compatible with the windows operating system. So for example if the file was placed on a Linux box, then you would have to install a windows networking system (Samba) and ALSO setup a mapped drive, or the very least a VPN (Virtual Private Network). The folder thus needs to appear as a mapped drive, or alternately appear in your network neighborhood, and you browse to the computer on that remote network, and then open folders on that computer and ONLY THEN can you OPEN the file.

    Again, I repeat:

    You ARE NOT connecting to a file, you need windows file system to OPEN the file. Using the term “connection” in place of opening a word file, an Excel file, or in this case an accDB file makes no sense.

    You can certainly use a socket based technology like TC/IP to connect to a web server, or a database server. However in this case you are SIMPLY requiring to OPEN a plane Jane windows file, and that file on the target computer MUST have the windows networking system that allows you to open that file with the windows file system. There is no concept of “connecting” here.

    Of course the other issue here is such connections are slow – about 100 times slower then your typical office network. You REALLY need to read the following article of mine to realize this limitation and speed issue:

    http://www.kallal.ca//Wan/Wans.html

    Now that we cleared up that you don’t connect to a database, but all users MUST be able to open the file.

    Assuming they are on the same network as you state, then simply have users browse to the folder where the database resides and they can double click on it.

    If you using PHP, then ANY and ALL connection strings will in fact resolve to a STANDARD windows file location. Assuming all users on your network have direct use of the file, then the path name in your PHP string to open this file will be:

    \\IP-address\folderName\myDatabase.accDB
    

    As noted, the users will need full rights to the above file and folder. If the PHP is running via a web site, then the computer running the web site will require full rights to the folder on the network, and as noted they ALL WILL have to be part of the same windows network. Of course if they use a web site, then ONLY the web site will require direct windows networking and file open ability (but again you require a direct file location and open ability via windows networking from that web server).

    评论

报告相同问题?

悬赏问题

  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本