开发者

Is it possible to access a MS Access database with PHP on a Linux Web Server?

开发者 https://www.devze.com 2022-12-09 23:03 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号