I am trying to read MDB data in my Codeigniter project. But it not working for me. I have followed this code:
<?php $dbname = APPPATH.'database/myfile.mdb'; if (!file_exists($dbname)) { die("Could not find database file."); } try { $dbname = APPPATH.'database/myfile.mdb'; $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$dbname;Uid=; Pwd=;"); $dbh = null; } catch (PDOException $e){ echo $e->getMessage(); } ?>
It gets the error “SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified”
Question and answer is powered by AnsPress.io