Dear InfinityFree support,
I’m trying to connect to an MDB database file through PDO odbc connection with PHP.
I’ve tried the following connection strings:
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
and
$db = new PDO("odbc:DRIVER=MDBTools; DBQ=$dbName; Uid=; Pwd=;");
But there’s the following error:
Fatal error: Uncaught PDOException: could not find driver in /home/xxxxxxxxxxxxxxxxxx:28 Stack trace: #0 /home/xxxxxxxxxxxxxxxxxx(28): PDO->__construct('odbc:DRIVER={Mi...') #1 /home/xxxxxxxxxxxxxxxxxx(19): include('/home/vol8_7/ep...') #2 {main} thrown in /home/xxxxxxxxxxxxxxxxxx on line 28
I had this same error on my localhost and I solved it by uncommenting this line in php.ini file:
extension=php_pdo_odbc.dll
I’ve tried to alter PHP.ini file from control panel but there’s no options to add extensions.
How can I solve it?
Waiting for your reply
Thanks