Connecting to MS Access 2007 using ODBC_CONNECT - error in driver?

前端 未结 2 417
终归单人心
终归单人心 2021-01-14 12:49

I have been successful in querying a Microsoft Access 2003 database (.mdb file) and now I am trying to do the same for a Microsft Access 2007. I have tried the following:

相关标签:
2条回答
  • 2021-01-14 13:31

    IKIK This is uber grave digging but..

    $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=" . $mdbFilename, $username, $password);
    

    This should work.

    0 讨论(0)
  • 2021-01-14 13:32

    In case anyone is wondering how to do this. This worked for me.

    try{
        $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $username, $password);
    }catch(PDOException $e){
        echo $e->getMessage();
    }
    
    0 讨论(0)
提交回复
热议问题