Does anyone know if it's possible to connect and query an MS Access database from a Linux Server using PHP?
If it is possible I'm thinking install ODBC driver on the Linux server, but will it work to connect to Access is the question. I've read it's possible with MSSQL.
My knowledge is very limited when it comes to any Windows related DBs so any advice much appreciated.
Yes, it's possible. I've done it using ODBTP, which took advantage of the ODBC driver on the (Windows) machine that hosted the Access database file.
It's also theoretically possible to use an ODBC driver on the Linux server to read an Access database on a Windows networking share if the Linux box can "see" it. However, I've never had very good luck with Access ODBC on Linux so I wouldn't recommend spending too much time trying to get it working.
Related
we have a Tool for managing the booked time at the different prjects of our customers an other things based on MS Access and we want to continue with it. Just for a better comfort I've made an PHP based Tool that is able to work with that database but it runs local on a windows system. Now I'd like to run it on our office webserver but that is a Linux system.
I use the PDO extension odbc and found the following docu to use the odbc extension on linux:
https://gist.github.com/amirkdv/9672857
But this only allows me to read the databse.
Do anybody knows a way to get full access to a MS Access Databse on a Linux system?
I'm looking forward to your answers^^
The Access database (not the application) doesn't "run" anywhere, it's a file, so all you need an SMB share which, on Linux, is what Samba provides.
If you wish to run the Access application on Linux, you will need Wine.
I'm working on getting information from a submitted HTML form entered automatically into an Access 2016 database. My understanding of this process is limited, so I ask that you bear with me.
The HTML form is stored on a 64-Bit Windows Server 2008 R2 DC that is doubling as a Web Server. PHP has also been installed and configured on this Server.
The database is stored on a separate 64-Bit Windows Server 2008 R2 Virtual Server.
I've seen plenty of articles regarding PHP and SQL (MySQL, SQL Server, etc.) but very little about PHP and MS Access. I understand now that I need to set up an ODBC Connection but that's where I begin to get lost.
Questions:
Am I correct in thinking the ODBC Connection needs to be set up/configured on the Web Server?
Am I correct in thinking only the 64-Bit ODBC Driver is required? (Although I'm pretty confident this is correct, I have this nagging doubt that, because some 32-Bit computers will be accessing the HTML form, there will also be a need to have the 32-Bit ODBC Driver. It may seem silly but I'd like confirmation with regards to this.)
Where is the ODBC driver? I did a search and it brought me to a download for "Microsoft Access Database Engine 2010 Redistributable". Is this what I'm looking for? (I admit that, unless it's pretty obvious, I tend to feel I'm in the wrong place. And unless someone can confirm that 'Redistributable' is the same as 'ODBC Driver', I'm inclined to think I'm looking at the wrong thing.)
Thanks for any help!
Eric
Since all of the code running on your web service is x64, then yes of course you will need the x64 Access (ACE) odbc driver.
You are correct in choosing Access Database Engine 2010 Redistributable. In fact, you might as well use the 2013 one. Don’t forget to choose the x64 version.
The fact that x32 or x64 computers connect to the web site is not relevant – the server and web code is running as an x64 in process and thus you need to use the x64 odbc driver for Access.
Also while the accDB access file CAN BE on the other server as you point out, that file name MUST be in a folder that that the web server has full rights to. So you not using an IP address, but a FULLY qualified windows path name to a legal windows folder and a legal windows file (in this case the access accDB file). So keep in mind that you do not connect to an Access database, but in fact are opening a windows file. You don’t connect to a word document, you open it. You don’t connect to a PowerPoint file, you open it. And you don’t connect to an Access accDB file, but your software (the odbc driver) will in fact do a DIRECT windows OS file open of the Access file.
So unlike a web site or say SQL server that allows a connection via a socket (tc/ip + a IP address), an Access file is NOT a socket based system, but is in fact a plane jane windows file that will be opened in-process by YOUR software. So the opening of the Access file occurs on the web server – even if that Access accDB simply a USB jump drive plugged into that server, or some other file share on the servers network. We talking about the code on the web server opening that Access file – that Access file thus must be located in a folder that is directly accessible by the web server code running.
Thus you don’t need the ACE data engine installed on that second server for example – only where the code is running do you need the ODBC driver. The significant issue here is that most ODBC drivers allow you to “connect” to some server with a database engine. Because Access is file based then BOTH the ODBC driver and the data engine MUST be installed on the computer that uses the ODBC driver. That driver thus will ALWAYS launch a copy of the data engine local and on the same computer using the ODBC driver. When you use say a SQL driver, you requite a local copy of the SQL database engine – with Access you do!
I am trying to connect to a MS Access Db that I have made from my apache server using PHP. I keep coming up with the error "could not find driver". I have searched through just about every web page on the internet and have found nothing of importance. I have undocumented the parts of the php.ini file to allow the odbc drivers to work. I also have tried to list all of the working drivers using the PDO::getAvailableDrivers() code yet nothing shows up no matter how many drivers I undocument from the php.ini file. I've created the DNS connection and linked it to the database yet I'm not sure how to connect to it.
Any help would be greatly appreciated.
For everyone else that needs an answer to this:
MS Access has stopped updating and hosting their odbc connection to php in 2010 (approximately). It will still work if you make sure you're using a 32-bit system. I'm now using 32-bit Apache and PHP. It works flawlessly now.
I have installed Hadoop 2.7 and Hive 1.2.1 on Ubuntu 14.04 that manage sensor data. I have already stored data sensor to Hive.
My Project is to make a web server from it and a web application that can show data record from hive table.
My problem is How to connect database Hive with php? I found Apache Thrift to do that. but I dont understand (Im new at Hadoop things)
Can someone give me tutorial or step by step to solve my problem
One way to try is to use ODBC. If you do not know, how to use ODBC. Read more on that via: Using PHP can I use a JDBC or ODBC connection?
Once, you can setup your ODBC connection, you can use ODBC to connect to the hiveserver. To install, ODBC here two links on how to do that on Cloudera resp. Hortonworks.
http://www.cloudera.com/downloads/connectors/hive/odbc/2-5-12.html
http://hortonworks.com/hadoop-tutorial/how-to-install-and-configure-the-hortonworks-odbc-driver-on-windows-7/
Does anyone know if it's possible to connect and query an MS Access database from a Linux Server using PHP?
If it is possible I'm thinking install ODBC driver on the Linux server, but will it work to connect to Access is the question. I've read it's possible with MSSQL.
My knowledge is very limited when it comes to any Windows related DBs so any advice much appreciated.
Yes, it's possible. I've done it using ODBTP, which took advantage of the ODBC driver on the (Windows) machine that hosted the Access database file.
It's also theoretically possible to use an ODBC driver on the Linux server to read an Access database on a Windows networking share if the Linux box can "see" it. However, I've never had very good luck with Access ODBC on Linux so I wouldn't recommend spending too much time trying to get it working.