Edgewalker81 Posted May 26, 2007 Share Posted May 26, 2007 After several hours of searching, I don't believe this is possible, but so far I haven't been told that specifically, so I'd like to know. It's like this: I'm running Apache/MySQL/PHP and recently my boss wanted me to create some pages that interface with the database files from another part of the company, and they're all Microsoft Access .mdb files sitting on a network drive. It easy to use ODBC to get at one file, but I need the ability to arbitrarily access files . ODBC is NOT an option, because there are at least 120 different .mdb files in system. Also, changing from Access to MySQL for them is not an option- our software there doesn't support it. Advice? Is this even POSSIBLE with php? Is there a server-side language that I could pick up that would be much better for this? (Preferably one that wouldn't cause me to have to dump Apache) Thanks! -Jason Quote Link to comment https://forums.phpfreaks.com/topic/53086-solved-ms-access-files-with-php-impossible/ Share on other sites More sharing options...
Edgewalker81 Posted May 26, 2007 Author Share Posted May 26, 2007 Ok - I found something, and for anyone who might also need to do this... http://aspn.activestate.com/ASPN/Cookbook/PHP/Recipe/123709 This is a bit more complex than I would have hoped, but it certainly seems like the path I need to take. Quote Link to comment https://forums.phpfreaks.com/topic/53086-solved-ms-access-files-with-php-impossible/#findComment-262244 Share on other sites More sharing options...
Edgewalker81 Posted June 1, 2007 Author Share Posted June 1, 2007 That code does not work, either. It gives me just a blank page starting from the point where it attempts to connect to the database file. Any code on earlier lines works as normal. Here it is for reference: <?PHP $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); // Microsoft Access connection string. The file is in the same directory as this script $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=Sample.mpq"); // SQL statement to build recordset. $rs = $conn->Execute("SELECT SchoolName FROM Schools"); // Display all the values in the records set while (!$rs->EOF) { $fv = $rs->Fields("SchoolName"); echo "Value: ".$fv->value."<br>\n"; $rs->MoveNext(); } $rs->Close(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/53086-solved-ms-access-files-with-php-impossible/#findComment-265981 Share on other sites More sharing options...
Fergusfer Posted June 1, 2007 Share Posted June 1, 2007 http://ca3.php.net/manual/en/faq.databases.php#faq.databases.access Quote Link to comment https://forums.phpfreaks.com/topic/53086-solved-ms-access-files-with-php-impossible/#findComment-265991 Share on other sites More sharing options...
Edgewalker81 Posted June 1, 2007 Author Share Posted June 1, 2007 The PHP reference was the first place I looked, but thank you for the suggestion. It's really not helpful unless I want to do one of two things: Make a MySQL database which synchronizes with the access db (not an option, I'd need to make 150 of them) or use ODBC in Windows and assign a DSN, which is ALSO not an option, because there are over 150 .mdb files, and the number and names changes periodically. I need to be able to access them arbitrarily without complex setup and lots of overhead. Edit: Fixed a typing error Quote Link to comment https://forums.phpfreaks.com/topic/53086-solved-ms-access-files-with-php-impossible/#findComment-266075 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.