====== Microsoft Access ======
~~NOTOC~~
== Specification ==
^Driver Name|access|
^Data Provider|odbc|
^Status|Active((This driver is actively supported by ADOdb project members)) |
^Windows|Yes|
^Unix|No|
^ADOdb V5|Yes|
^ADOdb V6|Yes|
== Alternatives ==
[[v5:database:pdo#pdo_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 =====
None
===== Driver Specific Issues =====
In ADOdb V5, the field type returned in [[v5:dictionary:metacolumns]] is the metaType, not the actualType. For more on this issue, see [[https://github.com/ADOdb/ADOdb/issues/184|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 [[http://stackoverflow.com/questions/1937703/record-cannot-be-read-no-read-permission-on-msysobjects|Stack Overflow]] response.
---------------------------
===== Connection Parameters Guidelines =====
==== Using a DSN Style Connection ====
^Field^Description^Common Example^
|$host|Use for the ODBC DSN Name|northwind|
|$userName|Not Required||
|$password|Not Required||
|$database|Not 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);
{{tag>[access supported tier2]}}