Database Abstraction Layer for PHP

User Tools

Site Tools


Microsoft Access

Driver Nameaccess
Data Providerodbc
ADOdb V5Yes
ADOdb V6Yes

ADO Driver For Access
PDO Driver For Access

This driver provides a connection to Microsoft Access databases, via an ODBC connection. The easiest way to connect to the database is to define a DSN in the ODBC connection manager and connect via that.

Driver Specific Options


Driver Specific Issues

In ADOdb V5, the field type returned in metaColumns is the metaType, not the actualType. For more on this issue, see This Thread on Github. This behaviour changed in Version 5.21, but a backward compatibility mode is provided:

$db = newAdoConnection('access');
$db->metaColumnsReturnType = METACOLUMNS_RETURNS_META;

Depending on the database security, some meta functions may not be available. For more information, try this Stack Overflow response.

Connection Parameters Guidelines

Using a DSN Style Connection

FieldDescriptionCommon Example
$hostUse for the ODBC DSN Namenorthwind
$userNameNot Required
$passwordNot Required
$databaseNot Required


$db= newAdoConnection('access');
$sql = 'select * from products';
$result= $db->Execute($sql);

Using a DSN less connection

$db = ADONewConnection('access');  
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\northwind.mdb;Uid=Admin;Pwd=;";
1) This driver is actively supported by ADOdb project members
v5/database/access.txt · Last modified: 2017/04/21 11:49 (external edit)