1
我想連接Microsoft Access數據庫使用PDO與odbc。我已經安裝的網絡驅動器上的文件,我想訪問他們,但我收到以下錯誤:'Microsoft Access驅動程序(* .mdb)':文件未找到'錯誤在連接pdo與odbc在php
PDOException' with message 'SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can't open lib 'Microsoft Access Driver (*.mdb)'': file not found'.
這裏是我的代碼:
$dbName = "/info/new.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$database = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq= $dbName;Uid=admin");
MS Access只能在需要反斜槓文件參考的Windows環境中使用。而對於PHP,則使用雙反斜槓而不是正斜槓。 – Parfait
所以我如何訪問該文件? – vyshnavi
環境:windows – vyshnavi