ODBC connection fails: could not find driver
Posted by: LesD (---.dessergroup.org)
Date: December 05, 2025 02:01PM

Just installed latest Wamp: 3.4.0 64 bit
On W11 64 bit, PHP 8.2.28; Apache: 24.65
Green icon

On W11 in ODBC Data Source Administrator it shows the Microsoft Access Driver 64 bit.

I'm tying to test making an odbc connection from PHP to to an Access database on the same PC.

I have enabled the odbc and PDO_odbc extensions (for php and for apache) (and restarted all services) and php info shows two entries
ODBC driver for PDO
ODBC

I have removed the ticks from MySQL and MariaDB as I just want to connect to MS Access.

Relevant lines only from php code

$dbPath = 'D:\\AllData\\Access\\Turner\\MiscPPD.mdb';
$AccessDriver = '{Microsoft Access Driver (*.mdb, *.accdb)}';
$dsn = "odbcgrinning smileyRIVER=$AccessDriver; DBQ=$dbPath";
$dbh = new PDO($dsn);

The last line crashes with error: could not find driver

All my googling points to php not finding its odbc driver. No one mentions the possibility of issues with the MS Access driver.

------------

At this point I added in the line above about MySQL being turned off and it triggered the though maybe ...

So I turned it on and bingo - it all works.

So I do not understand why we need MySQL turned on but in any event, I decided to post this as it may help others.

I would prefer MySQL to be off but if it has to be on then so be it.

Options: ReplyQuote
Re: ODBC connection fails: could not find driver
Posted by: LesD (---.dessergroup.org)
Date: December 06, 2025 11:10PM

It would be useful to know whether it is possible to make an odbc connection to MS Access without the MySQL service running.

Options: ReplyQuote
Re: ODBC connection fails: could not find driver
Posted by: Otomatic (Moderator)
Date: December 07, 2025 09:25AM

Hi,

I have absolutely no idea!
It might be interesting to find out if the same thing happens when using only the wampmariadb64 service instead of the wampmydqld64 service.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.