i'm trying to connect to an old Access database (c:\content.mdb
) using the odbc driver Microsoft Access Driver (*.mdb)
version 10.00.22624.01 (installed from this link: https://www.microsoft.com/en-us/download/details.aspx?id=13255).
The connection string i'm using is the following: Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\content.mdb; Uid=; Pwd=;
If i try to connect with an ancient php version (php v5.4.45, which has odbc extension v1.0), everything is fine.
If i try to connect with a "modern" php version (php v8.1.12 with odbc extension v8.1.12) or any DBMS supporting odbc (eg DBeaver v22.2.4, which uses jdbc:odbc
), i get the following error:
SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
The connection string (hence the odbc driver used) is exactly the same. Using php's PDO
or odbc_*
functions yields the same results.
So why is this happening? Why does it work with php 5.4 but fails with anything else?