Skip to content

samyabdellatif/access2sqlite

Repository files navigation

Access to SQLite Converter

A Python utility to convert Microsoft Access databases (.accdb, .mdb) to SQLite format on MS Windows systems.

access2sqlite

Features

  • Lightweight executable (~13 MB) - Optimized build without heavy dependencies
  • Converts Microsoft Access databases (.accdb, .mdb) to SQLite format
  • Handles both Access 2003 (.mdb) and Access 2007+ (.accdb) formats
  • Processes tables in chunks to handle large databases efficiently
  • Preserves table structure and data types
  • Command-line interface with multiple options
  • Automatic Access ODBC driver detection with helpful error messages
  • Robust error handling with partial conversion support
  • Thread-safe cancellation in GUI mode
  • Detailed conversion summaries showing successful and failed tables

Installation

Install the required dependencies:

pip install pyodbc

For the Python scripts (optional pandas-based legacy version):

pip install pyodbc pandas

GUI Version

A graphical user interface version is available as an executable file for easy use without Python installation:

Screenshot 2026-01-04 011609

Download

Download Executable

The GUI version provides the same functionality with a user-friendly interface for drag-and-drop conversion.

Usage

Basic Conversion

python access2sqlite.py database.accdb

This will create database.sqlite in the same directory.

Custom Output Path

python access2sqlite.py database.accdb --output converted.sqlite

Memory-Efficient Conversion for Large Databases

python access2sqlite.py database.accdb --chunk-size 500

Show Database Information

python access2sqlite.py database.accdb --info

This displays table names and record counts without converting.

Verbose Logging

python access2sqlite.py database.accdb --verbose

Command-Line Options

  • --output, -o - Specify output SQLite file path (default: same as input with .sqlite extension)
  • --chunk-size, -c - Number of rows to process at once (default: 1000)
  • --info, -i - Show database information without converting
  • --verbose, -v - Enable verbose logging

Requirements

  • Python 3.6+
  • pyodbc (for Access database connectivity)
  • pandas (for data processing)
  • sqlite3 (built into Python)

Error Handling

The converter includes comprehensive error handling for:

  • Missing Access database files
  • Invalid file formats
  • Database connection issues
  • Table conversion failures
  • Missing Microsoft Access ODBC drivers (with helpful installation instructions)
  • Resource cleanup on errors (connections properly closed)

Partial Conversion Support: If some tables fail to convert, the tool will:

  • Continue converting remaining tables
  • Keep the partial SQLite database
  • Log a detailed summary showing which tables succeeded and which failed
  • Report specific error messages for each failed table

Notes

  • The converter requires Microsoft Access Database Engine to be installed on Windows for pyodbc to work with Access files
  • Large databases are processed in chunks to prevent memory issues
  • All tables in the Access database are converted automatically
  • The converter preserves data types and table structure as much as possible
  • Tables with an ID column are paginated efficiently; tables without ID columns are read in full
  • SQL syntax is optimized for Microsoft Access compatibility (uses TOP instead of LIMIT)