Trying to connect to access database with PDO

前端 未结 1 349
盖世英雄少女心
盖世英雄少女心 2021-01-22 12:23

I am trying to connect to access database that I have on the c drive. I uncommented access extension pdo in INI file. I ran the driver test and it shows odbc driver is installed

相关标签:
1条回答
  • 2021-01-22 13:14

    Try doing it this way should work.

    <?php
    try {
    
     $conn = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\\staffing.mdb;Uid=Admin");
    
    }
    catch (PDOException $e) {
      echo $e->getMessage();
    }
    ?>
    
    0 讨论(0)
提交回复
热议问题