I am using WAMP server for my PHP Server and am trying to connect to an Access Database with the extension of accdb, but I keep getting the error "could not find driver". Here is the code I'm trying to run:
$dbName = $_SERVER["DOCUMENT_ROOT"]."/Ridley/RLCompRepair.accdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
try {
$db = new PDO("odbc:Driver={MS Access Database (*.mdb, *.accdb)};Dbq=$dbName");
} catch (PDOException $e) {
echo "Error: ".$e->getMessage();
}
I have enabled the php_pdo_odbc extension, so I'm pretty sure this is not the problem. Could someone please let me know what is wrong?
Chris