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

前端 未结 2 443
终归单人心
终归单人心 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: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();
    }
    

提交回复
热议问题