Why MDB Files Linger
Microsoft Access was the small-business database default from the late 1990s through 2010s. MDB (Microsoft Database) files contain tables, queries, forms, reports, and macros. Many businesses still have decades of data in MDB files that nobody has migrated.
In 2026, MDB is increasingly orphaned:
- Modern Access uses ACCDB (since 2007)
- Microsoft hasn't shipped a Mac version since 2009
- Cloud and mobile workflows don't support MDB
- Younger employees have never used Access
This post covers extracting data from MDB files for migration to modern databases or formats. For broader spreadsheet context, see XLS vs XLSX vs CSV.
What's in an MDB File
| Component | Description |
|---|---|
| Tables | Actual data |
| Queries | Saved SQL views |
| Forms | UI for entering data |
| Reports | Print-formatted output |
| Macros | Automation |
| VBA modules | Code |
For data migration, you mainly need the tables. Queries can be useful (preserved business logic). Forms, reports, macros, and code rarely transfer to modern systems.
Export Tools
| Tool | OS | Cost | Notes |
|---|---|---|---|
| Microsoft Access | Windows | Paid | Native, full-featured |
| Office 365 Access | Windows | Subscription | Same as desktop |
| LibreOffice Base | Cross-platform | Free | MDB read-only |
| MDB Tools | Linux/Mac | Free | Command-line MDB extraction |
| mdbtools-win | Windows | Free | Windows port of MDB Tools |
| Online conversion services | Web | Various | Privacy concerns |
For Windows users with Access: native export is best. For Mac/Linux or non-Access users: MDB Tools.
Microsoft Access Export Workflow
For native Windows Access:
- Open the MDB file in Access
- External Data tab > Text File
- Select "Export"
- Pick destination CSV file
- Choose comma delimiter and "First row contains column names"
- Click OK
For batch export of multiple tables: use the macro builder or VBA.
For each table individually:
- Tables list > right-click > Export
- Select format (CSV, Excel, XML, etc.)
Native Access also exports to Access ACCDB (the modern format), which has better tool support than MDB.
MDB Tools (Linux/Mac/Windows)
For non-Windows or non-Access workflows:
# Install on macOS
brew install mdbtools
# Install on Ubuntu
sudo apt install mdbtools
# List tables
mdb-tables database.mdb
# Export specific table to CSV
mdb-export database.mdb TableName > TableName.csv
# Export all tables
for table in $(mdb-tables -1 database.mdb); do
mdb-export database.mdb "$table" > "${table}.csv"
done
MDB Tools is the open-source standard. Reads MDB files reliably without Microsoft Access installed.
For batch processing, see Batch Processing Files Guide.
LibreOffice Base
For LibreOffice users:
- LibreOffice Base > Open existing database
- Select MDB file
- Database opens in read-only mode
- Right-click table > Copy
- Paste into Calc or Writer
- Save as CSV
LibreOffice Base reads MDB but doesn't write it. For one-off export: works. For automation: command-line MDB Tools.
Schema Extraction
For migrating to a modern database, you need the schema (tables, columns, types):
# Get schema as SQL CREATE TABLE statements
mdb-schema database.mdb > schema.sql
# Get specific table schema
mdb-schema database.mdb -T TableName
The output is SQL DDL that can be modified for the target database (PostgreSQL, MySQL, SQLite). Manual review is recommended; some Access types don't translate exactly.
Type Mapping
Access types and their CSV/SQL equivalents:
| Access type | CSV | PostgreSQL/MySQL |
|---|---|---|
| Text (255) | Text | VARCHAR(255) |
| Memo | Text | TEXT |
| Number (Long Integer) | Integer | INTEGER |
| Number (Double) | Number | DOUBLE PRECISION |
| Date/Time | Date string | TIMESTAMP |
| Currency | Number | DECIMAL(19,4) |
| Yes/No | TRUE/FALSE | BOOLEAN |
| OLE Object | Skip | BYTEA (BLOB) |
| Hyperlink | Text | TEXT |
| Attachment | Skip | (custom handling) |
For migration: simple types map cleanly. OLE Objects (embedded Excel sheets, images) are problematic. Plan for special handling.
Encoding Issues
Old MDB files often have encoding inconsistencies:
- Windows-1252 (common Western Europe legacy)
- UTF-8 (modern, less common in old MDB)
- Mixed (some fields one encoding, others another)
For MDB Tools:
# Specify input encoding
mdb-export -e CP1252 database.mdb TableName > TableName.csv
Convert to UTF-8 in post:
iconv -f CP1252 -t UTF-8 input.csv > output.csv
For batch:
for f in *.csv; do
iconv -f CP1252 -t UTF-8 "$f" > "utf8/${f}"
done
Migration to Modern Database
Common migration patterns:
MDB → SQLite:
# Extract schema
mdb-schema database.mdb sqlite > schema.sql
# Create SQLite database
sqlite3 newdb.sqlite < schema.sql
# Export and import each table
for table in $(mdb-tables -1 database.mdb); do
mdb-export -I sqlite database.mdb "$table" >> insert.sql
done
sqlite3 newdb.sqlite < insert.sql
MDB → PostgreSQL:
mdb-schema database.mdb postgres > schema.sql
psql -d newdb -f schema.sql
for table in $(mdb-tables -1 database.mdb); do
mdb-export -I postgres database.mdb "$table" > "${table}.sql"
psql -d newdb -f "${table}.sql"
done
MDB → CSV → SQL:
# Export to CSV
mdb-export database.mdb TableName > TableName.csv
# Import to PostgreSQL
psql -c "\copy TableName FROM 'TableName.csv' DELIMITER ',' CSV HEADER"
For tooling preferences: each option has trade-offs. Direct SQL is faster; CSV is more flexible.
Common Issues
File appears empty in MDB Tools: Access's Compact and Repair feature is needed. Try opening in Microsoft Access first to verify integrity.
Date columns export as numbers: Access dates are days since 1899-12-30. MDB Tools may export as serial number; convert in post-processing.
Memo fields truncated: some tools limit text length. MDB Tools handles long memos correctly.
Special characters mangled: encoding mismatch. Specify input encoding with -e flag.
Cannot open MDB with password: protection. Need the password. MDB Tools can't bypass passwords (encryption).
For broader CSV processing, see Batch Text Replacement in CSV.
Frequently Asked Questions
Can I convert MDB to ACCDB?
Yes via Access (File > Save As > Access Database). ACCDB has better tool support and modern features.
Should I migrate or keep MDB?
For active business systems: migrate to modern database. For historical reference: archive MDB and CSV exports.
What about Access on Mac?
No native Access. Use Parallels/VMware to run Access on Windows. Or use MDB Tools to extract data without Access installed.
Can I batch-process many MDB files?
Yes via shell script. MDB Tools handles this well. For 100 MDB files: 30-60 minutes typical.
Are there security risks in old MDB files?
VBA macros can contain malware. Treat unfamiliar MDB files cautiously. Disable macros before opening (Trust Center > Disable all macros).
What about Access running on cloud (Azure)?
Microsoft hosts Access on Azure VMs. For new development: not recommended. For maintaining legacy systems: workable.
Related Reading
Bottom Line
For Microsoft Access MDB export in 2026: Access (Windows) for full features, MDB Tools for cross-platform CLI. Export tables to CSV with explicit encoding. Migrate schema and data to modern database (SQLite, PostgreSQL, MySQL) for active workflows. Archive original MDB for historical reference. Our document converter handles related format conversions.



