AV1611 Posted December 26, 2006 Share Posted December 26, 2006 I have an Access .mdb on a remote server that I need to read from a php script.Will PHP read mdb? Do I have to do odbc? Quote Link to comment Share on other sites More sharing options...
craygo Posted December 26, 2006 Share Posted December 26, 2006 I believe you have to use odbc. Can look at this tutorialhttp://www.phpfreaks.com/tutorials/61/0.phpRay Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 26, 2006 Author Share Posted December 26, 2006 Problem is, I use Linux not Windows... Quote Link to comment Share on other sites More sharing options...
trq Posted December 27, 2006 Share Posted December 27, 2006 odbc is available on Linux. Whats the problem? Quote Link to comment Share on other sites More sharing options...
Barand Posted December 27, 2006 Share Posted December 27, 2006 Another option is to use an ADO connection with a COM object. Again, Google is your friend. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 27, 2006 Author Share Posted December 27, 2006 ThorpeThere is an access odbc for linux available?I run MyODBC alreadyBarand..I have no idea how to do ado object in PHP???All I really need to do is pull a mdb into mysql. I just don't know how to get it done in Linux... I've repented of my Windows ways... LOL Quote Link to comment Share on other sites More sharing options...
trq Posted December 27, 2006 Share Posted December 27, 2006 [url=http://php.net/odbc]odbc[/url]. Quote Link to comment Share on other sites More sharing options...
craygo Posted December 27, 2006 Share Posted December 27, 2006 When I transfered my ms access database into mysql I created a ODBC connection to the MySQL database then exported each table from Access out to MySQL. I did this in windows. Load up mysql on the windows box, takes about 2 minutes to do, install the odbc driver for mysql and export away. Once it is exported to mysql on windows you can use phpmyadmin to export everything out and import it into the linux MySQL. I know it seems like alot but it is real easy to export the tables right out of ms access into mysql. It creates the tables for you and puts in the data. You may have to go in and fix the field types but no biggy. And no Coding needed :) It will probably take you longer to write the code than it would to do everything above.Ray Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 27, 2006 Author Share Posted December 27, 2006 Thanks, but I did a poor job of explaining myself...I am very adept at using ODBC with PHP and have written many apps using windows...I moved to a Linux (LAMP) server and am trying to never use windows again (I know that is not possible... yet)I am trying to do this entirely in Linux... I am checking the link above now...I did find a class called php that someone wrote too Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 27, 2006 Author Share Posted December 27, 2006 How do I fix this error?Fatal error: Class 'COM' not found in /xxxx/xxxx/public_html/aao/mdb.php on line 2[code]<?$conn = new COM("ADODB.Connection") or die("Cannot start ADO");// Microsoft Access connection string.$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=mbl.mdb");// SQL statement to build recordset.$rs = $conn->Execute("SELECT * FROM mbl");echo "<p>Below is a list of values in the MYDB.MDB database, MYABLE table, MYFIELD field.</p>";// Display all the values in the records setwhile (!$rs->EOF) { $fv = $rs->Fields("myfield"); echo "Value: ".$fv->value."<br>\n"; $rs->MoveNext();}$rs->Close();?>[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted December 27, 2006 Share Posted December 27, 2006 You can't use COM on Linux of thats what your attempting. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 27, 2006 Author Share Posted December 27, 2006 So I still don't know how to do this without M$... Quote Link to comment Share on other sites More sharing options...
trq Posted December 27, 2006 Share Posted December 27, 2006 Um... use [url=http://php.net/odbc]odbc[/url]. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 27, 2006 Author Share Posted December 27, 2006 Thorpe,Where do I get an Linux ODBC driver for M$ Access?I guess that is my problem...I can't find one (that works)I currently use unixodbc and have myODBC working with OpenOffice BASE... Quote Link to comment Share on other sites More sharing options...
trq Posted December 27, 2006 Share Posted December 27, 2006 You need to create a DSN on the windows machine. Been a long while since Ive done anything in windows, but you should be able to google some tutorials on the subject if needed. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted December 28, 2006 Author Share Posted December 28, 2006 Creating a DSN on a windows machine only helps if you want to use the windows machine. I need to create the DSN on the linux machine by adding a access odbc to it. I cannot find a linux odbc driver for access. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.