ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:access

This is an old revision of the document!


Microsoft 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.

Support Status

This driver is actively supported by ADOdb project members

Specification

Driver Nameaccess
StatusActive
Supported OSWindows

Driver Specific Options

None

Connection Parameters Guidelines

Using a DSN Style Connection

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

Example

$db= newAdoConnection('access');
$db->connect('northwind'); 
 
$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=;";
$db->Connect($dsn);
v5/database/access.1448572841.txt.gz · Last modified: 2017/04/21 11:26 (external edit)