Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,150 of 9,150 pages
About the help in other languages
All help pages

MS Access support

This page is for administrators who have data in Microsoft Access files (.accdb, .mdb) and for developers who work on the Access driver. From Exponential 6.0.15 the kernel has two pieces for Access:

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/6.0/ms-access-support.md

On this page

MS Access support

This page is for administrators who have data in Microsoft Access files (.accdb, .mdb) and for developers who work on the Access driver. From Exponential 6.0.15 the kernel has two pieces for Access:

  1. An import tool, exp:access:import, that copies the tables of an Access file into the site's database or into a data table connection, on Linux with MDBTools (no Access needed) and on Windows with Microsoft's Access ODBC driver.
  2. A small Access driver, expMSAccessDB (databaseName() is MSAccess), over ODBC: Windows with the Access Database Engine (ACE, x64) reads and writes; on Linux only the import reads Access files (MDBTools' ODBC driver is not usable from PHP).

Recommendation: import, do not run on Access. Access is a file database for one desktop. Use the import for anything real, and keep the driver for reading an Access file in place or for a small read-mostly data table on Windows. A site on Access is not supported; how far one gets is measured below.

Contents

  1. Importing an Access file
  2. The Access driver
  3. What works and what does not
  4. A minimal site on Access
  5. Installing the drivers
  6. Tests

Importing an Access file

./console exp:access:import shop.accdb --list                       # the tables and their columns
./console exp:access:import shop.accdb --prefix=shop_               # the plan: tables to make, nothing written
./console exp:access:import shop.accdb --prefix=shop_ --apply       # make the tables, copy the rows
./console exp:access:import shop.mdb --connection=archive --tables=Customers,Orders --mode=replace --apply --format=json
OptionMeaning
--connectionsite (the default) or the identifier of a data table connection (any engine with a schema: MySQL/MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, ODBC, Access)
--tablesonly these Access tables (comma list, names as in the file)
--prefixin front of every table name, e.g. shop_
--modecreate (new tables; a table with rows already is left alone), append, replace (delete the rows first)
--readerauto, mdbtools (Linux, macOS, BSD) or odbc (Windows, ACE)
--applywrite; without it the command shows the plan only

Exit code 0 when every table and row arrived, 1 when one failed (the failed rows are listed, the others are written), 2 for wrong options or a file that cannot be read.

Names become lower case ASCII with _ (Order Details -> order_details, Umsätze -> umsaetze, Größe -> groesse); an SQL keyword gets a trailing _ (Order -> order_). Types: AutoNumber -> auto_increment (the key of the table; an Access key on other columns stays a unique index), Byte/Integer/Long Integer/Yes-No -> int, Large Number -> bigint, Single/Double -> double, Currency/Decimal -> decimal, Date/Time -> varchar(19) Y-m-d H:i:s (Access keeps no time zone), Short Text -> varchar(n), Long Text -> longtext, OLE object and binary -> longtext in base64, Replication ID -> char(38). A key column is NOT NULL. Ids are copied as they are (SQL Server: IDENTITY_INSERT; PostgreSQL: the sequences are moved past the highest id). Rows go in transactions of 500; a row the target refuses is reported and its batch is written row by row.

Measured on 2026-11-25 with MDBTools 1.0.0 on Linux, importing MDBTools' test files:

FileFormatTablesRowsSQLite (PDO)SQL Server, PostgreSQL, MariaDB, SQLite (ODBC)
nwind.mdbJET3 (Access 97)9, one named Umsätze4,032every rowevery row
DateTestDatabase.mdbJET4 (Access 2000-2003)16every rowevery row
ASampleDatabase.accdbACE12 (Access 2007 and later)1 (Asset Items, a text key)65every rowevery row

Checked values: names and dates of an employee, a price, a Yes/No column, photos as base64. Found and fixed on the way: MDBTools refuses a table name such as Umsätze in the C locale (the importer runs it in C.UTF-8); SQL Server refuses a key on a nullable column and MariaDB a NOT NULL column with DEFAULT NULL (key columns are now NOT NULL with a default). On Windows the job msaccess-windows imports the same files through the ODBC reader.

The Access driver

[DatabaseSettings]
DatabaseImplementation=msaccess
Database=C:\data\shop.accdb

[MSAccessSettings]
Driver=Microsoft Access Driver (*.mdb, *.accdb)
ExtendedAnsiSQL=enabled

ImplementationAlias[msaccess] and [access] name expMSAccessDB. [MSAccessSettings]: Driver (empty: ACE on Windows, MDBTools elsewhere), ExtendedAnsiSQL (ANSI-92 mode: DEFAULT and DECIMAL in CREATE TABLE, BAND/BOR; enabled), ReadOnly, Exclusive, ConnectionString, Layer (auto takes PHP's odbc extension first, the only layer that can list Access's tables). As a data table connection: Engine=msaccess, the file in one of datatable.ini [ConnectionSettings] SQLiteDirectories.

The Access dialect (expMSAccessDialect):

Kernel wordAccess
LIMIT nTOP n after SELECT [DISTINCT]; a UNION or a statement with its own TOP is wrapped
OFFSET mnone: arrayQuery() reads TOP m+n and drops the first m rows in PHP; sqlLimit() with an offset throws expDBUnsupportedException
AUTO_INCREMENTCOUNTER (AutoNumber); the new id from SELECT @@IDENTITY
CONCAT(), ||&
CASE WHENIIf()
SUBSTRING(), LENGTH()Mid(), Len()
date literals#yyyy-mm-dd hh:nn:ss#
`name`[name] (a name cannot hold ], at most 64 characters)
several statementsone per call: query() cuts a script at its semicolons and runs them in turn (not atomic unless in a transaction)
commentsremoved (Access takes none)
UNIX_TIMESTAMP()the date's days as a Double times 86400 (DateDiff in seconds overflows after 2038); Now() is the machine's local time
&, | (bits)BAND/BOR in ANSI-92 mode; without it exact integer arithmetic for a constant mask
upsert, GROUP_CONCAT, MD5()none: expDBUnsupportedException (do it in PHP)
FOR UPDATEleft out: the engine locks pages itself

What works and what does not

Windows: measured by the GitHub job msaccess-windows (windows-2022 and windows-2025, Access Database Engine 2016 x64, PHP 8.4). Linux: measured on 2026-11-25 with MDBTools 1.0.0 (Ubuntu 24.04).

WhatWindows, ACE x64 (msaccess-windows)Linux, MDBTools
import (exp:access:import)works through the ODBC reader for Access 2000 and later files (JET4 .mdb, ACE .accdb: DateTestDatabase.mdb, ASampleDatabase.accdb); not Access 97 files (JET3: ACE 2016 refuses nwind.mdb, "created with a previous version"): import those with MDBToolsworks: MDBTools' programs, JET3, JET4 and ACE files (above)
expMSAccessDB connect, list tables (SQLTables), describe columnsworks (AL-01)does not: the MDBTools ODBC driver connects through PDO_ODBC, but cannot fetch rows ("Driver does not support this function", SQLFetchScroll) and its SQL parser refuses TOP, COUNT(*), JOIN and INSERT; with PHP's odbc extension the process ended without a message. Use the import
DDL from .dba (COUNTER, TEXT(n), LONGTEXT, DECIMAL, DEFAULT, indexes)works (AL-02)-
insert and @@IDENTITYworks (AL-03); DECIMAL(19,0) keeps 2^53 + 1-
paging (TOP, offset dropped in PHP; TOP's ties)works (AL-04); a bare TOP 3 returned 4 rows (ties), arrayQuery() 3-
&, IIf, Mid, Len, dates, time stamps past 2038, BAND/BOR and the emulationworks (AL-05); past 2038 since the days-as-Double form (DateDiff/DateAdd in seconds failed: "Numeric value out of range")-
transactionsworks (AL-06)-
Unicode, 1 MB long textworks (AL-07)-
scripts of several statements, commentsworks (AL-08)-
refused: LIMIT, OFFSET FETCH, FOR UPDATE, MERGE, upsert, GROUP_CONCAT, MD5, TEXT(300); a second writer on a locked rowall refused (AL-09): "Syntax error in FROM clause" (LIMIT, FOR UPDATE), "Reserved error (-1001)" (OFFSET FETCH), "Invalid SQL statement" (MERGE), "Size of field is too long" (TEXT(300)), "Could not update; currently locked" (second writer)-
data table connection (engine msaccess)not measured: the CI file is outside SQLiteDirectories (AL-10 skips)-

Measured on 2026-11-26 by expMSAccessLiveTest in the job msaccess-windows on windows-2022 and windows-2025 (the same result on both); the job runs with every push to main, and its log lists what Access refused.

Limits of Access itself (Microsoft's specifications, not measured here): 2 GB per file including system objects; 255 columns per table; 255 characters in a Short Text; 32 indexes per table; 255 concurrent users in theory, far fewer in practice; one lock file (.laccdb) next to the database, so the directory must be writable by every user; no server process, every client reads the pages over the file system (over a network share a dropped connection can corrupt the file).

A minimal site on Access

The test expMSAccessKernelSchemaTest makes the kernel's schema (share/db_schema.dba) in an empty .accdb, writes the kernel's data (share/db_data.dba), then runs kernel reads with Access as the site's database. Its report is the artifact msaccess-kernel-probe-<os> of the job.

Measured on 2026-11-26 in the job msaccess-windows (windows-2022 and windows-2025, ACE 2016 x64, PHP 8.4, the odbc layer, ANSI-92 mode; the same result on both):

LevelResult
the kernel schema (153 tables of share/db_schema.dba)works: every table and index made
the kernel data (share/db_data.dba, 41 tables)works: 3,837 of 3,837 rows written
kernel reads with Access as the site's database3 of 10 work: the language list, a language mask with bitAnd(), a page of sections through eZPersistentObject
eZContentObject::fetch(), eZContentClass::fetchByIdentifier(), subtree fetch and countfail: "Data type mismatch in criteria expression" (the kernel compares number columns with quoted values, id = '1'; Access refuses what every server converts)
eZContentObjectTreeNode::fetch()fails: "Syntax error (missing operator)": Access needs every join after the first in parentheses
eZUser::fetchByName()fails: "Reserved error (-1001)"
eZURLAliasML::fetchByPath() (every URL)fails: the URL aliases are found by MD5() in SQL, which Access does not have

Verdict: a site on Access is not viable. The schema and the data go in, but the kernel's reads need a translation of its SQL that knows the type of every column (to unquote numbers), puts joins in parentheses and computes MD5() in PHP, and every write path that uses sqlUpsert() or GROUP_CONCAT would need another; none of that exists, so the installers do not offer Access. A DFS cluster on Access is not possible: Access is a file that every client opens over the file system, with one lock file (.laccdb) next to it; several web servers would open it over SMB, which Microsoft does not support for concurrent writers and which can corrupt the file on a dropped connection, and on one server the plain file handler does all a one-node cluster would. Use Access as an import source (exp:access:import), and on Windows run the site on SQL Server Express or LocalDB, through sqlsrv or over ODBC.

Installing the drivers

  • Linux, import only: apt install mdbtools (Debian, Ubuntu) or dnf install mdbtools (EPEL); the importer needs mdb-tables, mdb-schema and mdb-json (MDBTools 0.9 or later). The package odbc-mdbtools (driver MDBTools) is not usable from PHP (above).
  • Windows: the Microsoft Access Database Engine 2016 Redistributable, x64 for a 64-bit PHP (accessdatabaseengine_X64.exe /quiet); PHP's odbc and pdo_odbc extensions. A new empty file is made with Access, or in PowerShell: (New-Object -ComObject ADOX.Catalog).Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\data\new.accdb"). A 32-bit Office on the same machine blocks the x64 engine's installer (/passive forces it, at your own risk).

Tests

FileWhereWhat
tests/tests/lib/ezdb/odbc/expMSAccessDialectTest.phpDB-lesstokens, names, literals, TOP, splitting, functions, bit emulation against PHP, DDL, the helpers
tests/tests/lib/ezdb/odbc/expODBCDBTest.phpDB-lessconnection strings with ACE's switches, MDBTools without, the dialect's expressions
tests/tests/kernel/classes/msaccess/expAccessImportTest.phpDB-lessnames, types, schema, the MDBTools schema parser, literals, an import into SQLite with a bad row, the modes
tests/tests/kernel/classes/msaccess/live/expAccessImportLiveTest.phpEXP_TEST_ACCESS_FIXTURESMDBTools' test files into SQLite and every ODBC target
tests/tests/lib/ezdb/odbc/live/expMSAccessLiveTest.phpWindows, EXP_TEST_MSACCESS_FILEthe driver on ACE, and what Access refuses
tests/tests/lib/ezdb/odbc/live/expMSAccessKernelSchemaTest.phpWindows, EXP_TEST_MSACCESS_KERNEL_FILEthe minimal site probe

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x