try{
$db = new PDO("odbc:driver={microsoft access driver (*.mdb)};dbq=".getcwd()."#db.mdb");
echo "Connectedn";
} catch (Exception $e) {
echo "Failed:".$e->getMessage();
}
The connection is successful! If not, please confirm that the PDO extension has been installed, open php.ini and check if there is such a sentence: extension=php_pdo_odbc.dll
If not, add it yourself. You can call phpinfo() to check whether the extension is installed correctly!
If there is anything in the red box in the picture, it is installed correctly.
There is a small note here. There must be a space in front of the string "(*.mdb)",