This topic is locked
[SOLVED]

 Using MDB on Linux

4/1/2011 7:02:13 AM
PHPRunner General questions
W
wpl author

Hi all,
is there any chance to host a PHPRunner-App using data from an Access database on a Linux machine?
Thanks

J
Jane 4/1/2011

I recommend you to contact your hosting admin if they support MS Access databases. Usually it's not possible.

W
wpl author 4/1/2011



I recommend you to contact your hosting admin if they support MS Access databases. Usually it's not possible.


Jane,
thanks for the information. I have full root access to the server and did already install unixODBC and libmdbtools/libmdbodbc. But simply copying the PHPRunner app and editing the datasource name in dbcommon.php does not work. Connect will actually work, but a simple "select count(*) from tablename" will not. I was just thinking anybody else would have been in need of a solution for this task.

Admin 4/1/2011

MS Access databases won't work on Linux machine. You either need to switch to another database or use a Windows server.

W
wpl author 4/1/2011



MS Access databases won't work on Linux machine. You either need to switch to another database or use a Windows server.


Sergey,
thanks for answering. Do you think that a commercial ODBC driver like
http://www.easysoft.com/products/data_access/odbc-access-driver/index.html
will also be of no help?

Admin 4/1/2011

The quote from the link above:

The Easysoft ODBC-Access Driver can open an Access database stored on a Windows share


These (and any other Unix ODBC drivers) will be able to connect to MS Access database only if database is located on Windows machine.

W
wpl author 4/1/2011



The quote from the link above:
These (and any other Unix ODBC drivers) will be able to connect to MS Access database only if database is located on Windows machine.


Sergey,
I think the above statement is somewhat misleading. The driver c a n open mdbs on a Windows share, but it need not to. This is an option if Windows users are to open the mdb at the same time. The manual comes with this example:
[ACCESS_SAMPLE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /home/myuser/ms-access/Northwind.mdb
and the free libmdbodbc.so can open a mdb located on the Linux filesystem (I tested this), but unfortunately with very rudimental SQL-support. If I find the time I will do some testing with the trial version of EasySoft and keep you informed.

Admin 4/1/2011

I would point this question to Easysoft support.
If there were a way to connect to MS Access database on Linux machine the whole Internet would be screaming.

Nothing useful comes up in fact: http://www.google.com/search?q=Microsoft+Access+Database+using+Linux+and+PHP

U
Ugain 4/1/2011



Hi all,
is there any chance to host a PHPRunner-App using data from an Access database on a Linux machine?
Thanks


Access, a component of Microsoft Office, will not run directly on any version of Unix/Linux.

It is easier, and cheaper, to use any number of free tools out there to convert MDB files to MySQL for hosting on Unix OS.
The EasySoft unixODBC driver is nothing more than driver code library residing on the Unix OS. This driver ONLY facilitates a remote connection to a MDB file that itself resides on a MS_Windows OS.
php on Unix --> unixODBC --> MS_Access (.mdb) file on a WinOS machine.

W
wpl author 4/3/2011



Access, a component of Microsoft Office, will not run directly on any version of Unix/Linux.

It is easier, and cheaper, to use any number of free tools out there to convert MDB files to MySQL for hosting on Unix OS.
The EasySoft unixODBC driver is nothing more than driver code library residing on the Unix OS. This driver ONLY facilitates a remote connection to a MDB file that itself resides on a MS_Windows OS.
php on Unix --> unixODBC --> MS_Access (.mdb) file on a WinOS machine.



Ugain,

Sergey,
thanks for your input. But by no means did I intend to run the software "Access" on Linux! I only wanted to use an mdb located on a Linux filesystem as a datastore. In the meantime I have been digging around with Easysoft ODBC-Access. What I did was:

  • run the PHPRunner app under Linux which does not work at all (after a successful connect none of the queries will succeed)
  • run the PHPRunner App under Windows, using debug mode.
  • copy and save some of the generated SQL strings (for 3 listpages) to a text file
  • use these SQL statements to query the mdb on Linux (!) via unixODBC/Easysoft ODBC-Access with PHP-ODBC (PHP 5.2.6 on Debian)
  • use these SQL statements to query the mdb on Linux (!) via iSQL (which comes with unixODBC)
    Results up to now:
  • simple queries like

"select * from table" or "select count (*) from table"



work fine with PHP-ODBC and, of course, with iSQL

  • even a query like:

"SELECT top 20 PAECHTER.Name1, PAECHTER.Vorname1, PAECHTER.Name2, PAECHTER.Vorname2, PAECHTER.Stellvertreter, PAECHTER.Strasse, PAECHTER.Hausnr, PAECHTER.PLZ, PAECHTER.Ort, PAECHTER.DEB, PAECHTER.Abbucher, FLAECHEN.Bemerkung, FLAECHEN.Lage, FLAECHEN.Flur, FLAECHEN.[Zähler], FLAECHEN.[Vertrag endet am], FLAECHEN.[Bemerkung zu Vertragsende], FLAECHEN.FLSTKEY, FLAECHEN.ID, FLAECHEN.Nenner, FLAECHEN.[Bemerkung zum Flurstück], FLAECHEN.FLAECHE, FLAECHEN.[Vertrag vom], FLAECHEN.Pachtbeginn, FLAECHEN.[Pachtzins jährlich], FLAECHEN.[Pachtzins jährlich Bemerkung], FLAECHEN.[Nächste Erhöhung] FROM PAECHTER LEFT OUTER JOIN FLAECHEN ON PAECHTER.FLSTKEY = FLAECHEN.FLSTKEY"



works fine

  • whereas the (simpler? looking) query

"SELECT top 20 FLSTKEY, Bemerkung, Lage, Flur, [Zähler], Nenner, [Bemerkung zum Flurstück], FLAECHE, [Vertrag vom], Pachtbeginn, [Pachtzins jährlich], [Pachtzins jährlich Bemerkung], [Nächste Erhöhung], [Vertrag endet am], [Bemerkung zu Vertragsende], ID FROM FLAECHEN ORDER BY 1 ASC"



will not work

  • two out of three queries will not work with PHP-ODBC
  • all but one of the PHPRunner generated queries will work with iSQL. I asked the manufacturer for advice.
  • all of the queries will work with PHP-ODBC on Windows (PHP 5.2.12)
    So the mdb does not need to be located on a Windows or SMB share (though it may be located there). Most of the problems seem to arise from somewhere in the bowels of PHP-ODBC.

B
bobdansei 4/4/2011



Ugain,

Sergey,
thanks for your input. But by no means did I intend to run the software "Access" on Linux! I only wanted to use an mdb located on a Linux filesystem as a datastore. In the meantime I have been digging around with Easysoft ODBC-Access. What I did was:

  • run the PHPRunner app under Linux which does not work at all (after a successful connect none of the queries will succeed)
  • run the PHPRunner App under Windows, using debug mode.
  • copy and save some of the generated SQL strings (for 3 listpages) to a text file
  • use these SQL statements to query the mdb on Linux (!) via unixODBC/Easysoft ODBC-Access with PHP-ODBC (PHP 5.2.6 on Debian)
  • use these SQL statements to query the mdb on Linux (!) via iSQL (which comes with unixODBC)
    Results up to now:
  • simple queries like

"select * from table" or "select count (*) from table"



work fine with PHP-ODBC and, of course, with iSQL

  • even a query like:

"SELECT top 20 PAECHTER.Name1, PAECHTER.Vorname1, PAECHTER.Name2, PAECHTER.Vorname2, PAECHTER.Stellvertreter, PAECHTER.Strasse, PAECHTER.Hausnr, PAECHTER.PLZ, PAECHTER.Ort, PAECHTER.DEB, PAECHTER.Abbucher, FLAECHEN.Bemerkung, FLAECHEN.Lage, FLAECHEN.Flur, FLAECHEN.[Zähler], FLAECHEN.[Vertrag endet am], FLAECHEN.[Bemerkung zu Vertragsende], FLAECHEN.FLSTKEY, FLAECHEN.ID, FLAECHEN.Nenner, FLAECHEN.[Bemerkung zum Flurstück], FLAECHEN.FLAECHE, FLAECHEN.[Vertrag vom], FLAECHEN.Pachtbeginn, FLAECHEN.[Pachtzins jährlich], FLAECHEN.[Pachtzins jährlich Bemerkung], FLAECHEN.[Nächste Erhöhung] FROM PAECHTER LEFT OUTER JOIN FLAECHEN ON PAECHTER.FLSTKEY = FLAECHEN.FLSTKEY"



works fine

  • whereas the (simpler? looking) query

"SELECT top 20 FLSTKEY, Bemerkung, Lage, Flur, [Zähler], Nenner, [Bemerkung zum Flurstück], FLAECHE, [Vertrag vom], Pachtbeginn, [Pachtzins jährlich], [Pachtzins jährlich Bemerkung], [Nächste Erhöhung], [Vertrag endet am], [Bemerkung zu Vertragsende], ID FROM FLAECHEN ORDER BY 1 ASC"



will not work

  • two out of three queries will not work with PHP-ODBC
  • all but one of the PHPRunner generated queries will work with iSQL. I asked the manufacturer for advice.
  • all of the queries will work with PHP-ODBC on Windows (PHP 5.2.12)
    So the mdb does not need to be located on a Windows or SMB share (though it may be located there). Most of the problems seem to arise from somewhere in the bowels of PHP-ODBC.


wpl
I also had several problems with these drives ODBC queries to linux and not only with the most PHPRunner with several others applications.
I solved the problem by doing a simple vm with windows XP on linux for apache and ODBC drive ... believe in me is the best way

W
wpl author 4/4/2011



wpl
I also had several problems with these drives ODBC queries to linux and not only with the most PHPRunner with several others applications.
I solved the problem by doing a simple vm with windows XP on linux for apache and ODBC drive ... believe in me is the best way


Rodrigo,
thanks for this information. Were your problems related to Microsoft mdbs only or did you test other ODBC datasources as well?

B
bobdansei 4/4/2011

i think the major problem is with MDBs ..
well i have a robot with nagios (for auto network tickets in my helpdesk) and with sql server this drivers work much better..