Id开发者_开发百科eally it would be brilliant if I could upload an .mdb file to a linux webserver and query it using php. Is this possible? If so how?
it looks like it is possible using mdbtools (in the repository), which should allow odbc access as well as a way to port to a different database.
Even if you can't use it directly, porting is an option.
Yes, you need to have ODBC drivers for Unix installed, or a better way would probably be to use PDO with php5.
*Stolen from elsewhere on the net, not tested.
try
{
$dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\accounts.mdb;Uid=Admin");
}
catch (PDOException $e)
{
echo $e->getMessage();
}
This question and answer may be of interest: PHP and Microsoft Access database - Connection and CRUD
精彩评论