Improved support for Access 2010, 2013, and 2016

Some Access 2010 files use 0x03 as the version number rather than
0x0103. For this reason I have changed the call to mdb_get_int32 to
mdb_get_byte.

In addition, according to the Library of Congress page:

https://www.loc.gov/preservation/digital/formats/fdd/fdd000463.shtml

Access 2016 uses 0x05 as the version number. I have inferred from the
Wikipedia page that Access 2013 likely uses 0x04.
This commit is contained in:
Evan Miller 2018-03-05 06:39:57 -05:00
parent e9ec76ea68
commit 0e9c1810f1
5 changed files with 20 additions and 4 deletions

View File

@ -9,7 +9,7 @@ SYNOPSIS
DESCRIPTION
mdb-ver is a utility program distributed with MDB Tools.
It will return a single line of output with 'JET3' for those files produced in Access 97 format, 'JET4' for those produced by Access 2000, XP and 2003, 'ACE12' for those produced by Access 2007, or 'ACE14' for those produced by Access 2010.
It will return a single line of output corresponding to the program that produced the file: 'JET3' (for files produced by Access 97), 'JET4' (Access 2000, XP and 2003), 'ACE12' (Access 2007), 'ACE14' (Access 2010), 'ACE15' (Access 2013), or 'ACE16' (Access 2016).
OPTIONS

View File

@ -66,9 +66,11 @@ enum {
};
enum {
MDB_VER_JET3 = 0,
MDB_VER_JET4 = 1,
MDB_VER_JET4 = 0x01,
MDB_VER_ACCDB_2007 = 0x02,
MDB_VER_ACCDB_2010 = 0x0103
MDB_VER_ACCDB_2010 = 0x03,
MDB_VER_ACCDB_2013 = 0x04,
MDB_VER_ACCDB_2016 = 0x05
};
enum {
MDB_FORM = 0,

View File

@ -71,6 +71,12 @@ MdbCatalogEntry *entry = mdb_get_catalogentry_by_name(mdb, "SummaryInfo");
case MDB_VER_ACCDB_2010:
version = "ACE 14 (Access 2010)";
break;
case MDB_VER_ACCDB_2013:
version = "ACE 15 (Access 2013)";
break;
case MDB_VER_ACCDB_2016:
version = "ACE 16 (Access 2016)";
break;
default:
version = "Unknown";
}

View File

@ -221,7 +221,7 @@ MdbHandle *mdb_open(const char *filename, MdbFileFlags flags)
mdb_close(mdb);
return NULL;
}
mdb->f->jet_version = mdb_get_int32(mdb->pg_buf, 0x14);
mdb->f->jet_version = mdb_get_byte(mdb->pg_buf, 0x14);
switch(mdb->f->jet_version) {
case MDB_VER_JET3:
mdb->fmt = &MdbJet3Constants;
@ -229,6 +229,8 @@ MdbHandle *mdb_open(const char *filename, MdbFileFlags flags)
case MDB_VER_JET4:
case MDB_VER_ACCDB_2007:
case MDB_VER_ACCDB_2010:
case MDB_VER_ACCDB_2013:
case MDB_VER_ACCDB_2016:
mdb->fmt = &MdbJet4Constants;
break;
default:

View File

@ -81,6 +81,12 @@ main(int argc, char **argv)
case MDB_VER_ACCDB_2010:
printf("ACE14\n");
break;
case MDB_VER_ACCDB_2013:
printf("ACE15\n");
break;
case MDB_VER_ACCDB_2016:
printf("ACE16\n");
break;
default:
printf(_("unknown database version\n"));
break;