<?php $dbName = $_SERVER["DOCUMENT_ROOT"] . "products\products.mdb"; if (!file_exists($dbName)) { die("Could not find database file."); } $db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
A successful connection will allow you to execute SQL commands from PHP to read or write the database. If, however, you receive a "PDOException Unable to Find Driver" error message, then it is likely that the PDO ODBC driver is not installed. Use the phpinfo () function to check the installation for links to PDOs.
If there is no entry for ODBC PDO, you need to make sure that your installation includes the PDO extension and ODBC drivers. To do this on Windows, uncomment the line extension = php_pdo_odbc.dll in php.ini, restart Apache and try connecting to the database again.
With the driver installed, the output from phpinfo () should contain the following information: https://www.diigo.com/item/image/5kc39/hdse

Aman maurya
source share