1[![Build Status](https://github.com/mdbtools/mdbtools/workflows/build/badge.svg)](https://github.com/mdbtools/mdbtools/actions)
2[![Build status](https://ci.appveyor.com/api/projects/status/22wwy5d0rrmk6e3c/branch/dev?svg=true)](https://ci.appveyor.com/project/evanmiller/mdbtools/branch/dev)
3[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/mdbtools.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:mdbtools)
4
5Welcome to the exciting world of MDB Tools! MDB Tools is a set of programs to
6help you extract data from Microsoft Access files in various settings. See the
7[NEWS](./NEWS) file for information about the latest release.
8
9## Components
10
11The major pieces of MDB Tools are:
12
13### libmdb
14
15The core library that allows access to MDB files programatically. See [mdbtools.h](./include/mdbtools.h.in) for the complete API.
16
17### libmdbsql
18
19Builds on libmdb to provide a SQL engine (aka Jet). See [mdbsql.h](./include/mdbsql.h) for the complete API.
20
21### utils
22
23Provides command line utilities, including:
24
25| Command | Description |
26| ------- | ----------- |
27| `mdb-ver` | Prints the version (JET 3 or 4) of an mdb file. |
28| `mdb-schema` | Prints DDL for the specified table. |
29| `mdb-export` | Export table to CSV or SQL formats. |
30| `mdb-json` | Export table to JSON format. |
31| `mdb-tables` | A simple dump of table names to be used with shell scripts. |
32| `mdb-count` | A simple count of number of rows in a table, to be used in shell scripts and ETL pipelines. |
33| `mdb-sql` | A simple SQL engine (also used by ODBC and gmdb). |
34| `mdb-queries` | List and print queries stored in the database. |
35| `mdb-hexdump`\* | (in [src/extras](./src/extras)) Simple hex dump utility to look at mdb files. |
36| `mdb-array`\* | Export data in an MDB database table to a C array. |
37| `mdb-header`\* | Generates a C header to be used in exporting mdb data to a C prog. |
38| `mdb-parsecsv`\* | Generates a C program given a CSV file made with mdb-export. |
39
40\* Deprecated
41
42See the man page of each program for usage instructions.
43
44The [src/util](./src/util) directory also contains a number of debugging tools, intended for developers. They are:
45
46| Command | Description |
47| ------- | ----------- |
48| `prcat` | Prints the catalog table from an mdb file. |
49| `prkkd` | Dump of information about design view data given the offset to it. |
50| `prtable` | Dump of a table definition. |
51| `prdata` | Dump of the data given a table name. |
52| `prole` | Dump of ole columns given a table name and sargs. |
53
54These tools are not installed on the host system.
55
56### odbc
57
58An ODBC driver for use with unixODBC or iODBC driver manager. Allows one to use MDB files with PHP for example.
59
60### gmdb2
61
62The Gnome MDB File Viewer and debugger. Recently ported to GTK+3 and moved to [mdbtools/gmdb2](https://github.com/mdbtools/gmdb2).
63
64## License
65
66Files in libmdb, libmdbsql, and libmdbodbc are licensed under LGPL and the
67utilities and gui program are under the GPL, see [COPYING.LIB](./COPYING.LIB)
68and [COPYING](./COPYING) files respectively.
69
70
71## Requirements
72
73First, you must have reasonably current installations of:
74
75* [libtool](https://www.gnu.org/software/libtool/)
76* [automake](https://www.gnu.org/software/automake/)
77* [autoconf](https://www.gnu.org/software/autoconf/) (version >= 2.64)
78
79If you want to build the SQL engine, you'll need
80[bison](https://www.gnu.org/software/bison/) (version >= 3.0) or
81[byacc](https://invisible-island.net/byacc/byacc.html), and
82[flex](https://github.com/westes/flex).
83
84If you want to build the ODBC driver, you'll need `unixodbc-dev` (version
852.2.10 or above) or [iodbc](http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/WelcomeVisitors).
86
87If you want to build man pages, you'll need
88[GNU awk](https://www.gnu.org/software/gawk/).
89
90
91## Installation
92
93Latest version is available at https://github.com/mdbtools/mdbtools
94
95### Debian
96
97```
98apt install mdbtools
99```
100
101### Homebrew
102
103```bash
104brew install mdbtools
105```
106
107### MacPorts
108
109```bash
110port install mdbtools
111```
112
113### From source
114
115If you have cloned the Git repository, you will first need to generate the
116`configure` file (skip this step if you have downloaded a formal release):
117
118```bash
119$ autoreconf -i -f
120```
121
122Then:
123
124```bash
125$ ./configure
126```
127
128OR for a complete install (requires bison, flex, and unixODBC):
129
130```bash
131$ ./configure --with-unixodbc=/usr/local
132```
133
134By default, MDB Tools is linked against the copy of
135[GLib](https://developer.gnome.org/glib/) returned by pkg-config. You can
136point to a different GLib installation using the `GLIB_CFLAGS` and `GLIB_LIBS`
137enivornment variables. Or, you can disable GLib entirely with the
138`--disable-glib` flag, in which case MDB Tools will use an internal
139implementation of GLib's functions.
140
141configure can be passed any of the following flags to turn on other
142capabilities.  Note that the options `--with-unixodbc` and `--with-iodbc` are
143mutually exclusive.
144
145```
146--with-unixodbc  specifies the location of the unixODBC driver manager and
147                 causes the unixODBC driver to be built.
148--with-iodbc     specifies the location of the iODBC driver manager and
149                 causes the iODBC driver to be built.
150```
151
152By default, the ODBC driver will be installed as /usr/local/lib/odbc/libmdbodbc.so,
153with a Unicode-capable driver at /usr/local/lib/odbc/libmdbodbcW.so.
154
155A list of general options is available in the [INSTALL](./INSTALL) file, and
156`configure --help` will give you the list of mdbtools specific options.
157
158```bash
159$ make
160```
161
162Once MDB Tools has been compiled, libmdb.[so|a] will be in the src/libmdb
163directory and the utility programs will be in the src/util directory.
164
165You can then install (to /usr/local by default) by running the following as root:
166
167```bash
168$ make install
169```
170
171Some systems will also need the ld cache to be updated after installation;
172You can do that running:
173
174```bash
175$ ldconfig
176```
177
178## Hacking
179
180If you are interested in helping, read the [HACKING](./HACKING) file for a description of
181where the code stands and what has been gleened of the file format.
182
183## Contact
184
185Please send bug reports to the new github repository.
186https://github.com/mdbtools/mdbtools/issues
187