SQLSTATE [IM002] SQLDriverConnect: 0conn. php & lt ;? Phptry & nbsp; {& nbsp; $ conn & nbsp ;=& nbsp; new & nbsp; PDO ("odb SQLSTATE [IM002] SQLDriverConnect: 0
Conn. php
try {
$conn = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=".realpath("../data/data.mdb"));
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
?>
Error prompt after running
Connection failed: SQLSTATE [IM002] SQLDriverConnect: 0 [Microsoft] [ODBC driver manager] no data source name found and default driver not specified
Baidu, Google, has been searching for a long time and does not know where the configuration is wrong. php_pdo_odbc.dll is enabled, phpinfo () also shows support for pdo/odbc, and the mdb file path is correct.
The system is win7sp1 x64.
PHP is 5.5.7 VC11 x64 Thread Safe
Apache is httpd-2.4.7-win64-VC11
Office is Office2010 x64
It is normal to connect to the mysql database with PDO, but an error occurs when connecting to the mdb. do you want to install or set any drivers: More