JetDatabaseWriter 2.0.0

dotnet add package JetDatabaseWriter --version 2.0.0
                    
NuGet\Install-Package JetDatabaseWriter -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JetDatabaseWriter" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JetDatabaseWriter" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="JetDatabaseWriter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JetDatabaseWriter --version 2.0.0
                    
#r "nuget: JetDatabaseWriter, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JetDatabaseWriter@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JetDatabaseWriter&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=JetDatabaseWriter&version=2.0.0
                    
Install as a Cake Tool

JetDatabaseWriter

NuGet Downloads Targets License: MIT

Fully managed .NET library for reading and writing Microsoft Access (JET/ACE) databases — no OleDB, ODBC, or ACE/Jet driver installation required.

Use it to query, migrate, or generate .mdb and .accdb files directly from your .NET applications and tools, without installing Microsoft Access.

Version 1.0.0 is the first release of JetDatabaseWriter.

The supported operating envelope defines the release scope, resource and recovery contracts, and evidence needed to broaden them.

Contents

Features

Support Feature Description
✅ Pure managed .NET Uses .NET APIs; no OleDB, ODBC, ACE/Jet driver, library P/Invoke, or native helper binaries
✅ JET3/JET4 & ACE Read, write and create Jet3/Jet4 .mdb and ACE .accdb databases. Pre-Jet3 formats are unsupported. Feature-specific limits apply; see limitations and the validation matrix.
✅ Read & write Create databases and tables; insert/update/delete rows; add/drop/rename columns
✅ Typed values int, DateTime, decimal, Guid, MEMO, OLE, Hyperlink — not just strings
✅ POCO + LINQ Rows<T>("...", o => …) auto-infers an index; FromIndex<T>(...) to override; async LINQ (Where/Take/FirstOrDefaultAsync/…) over IAsyncEnumerable<T>
✅ IQueryable Query<T>(...) is an IQueryable<T> with Where/OrderBy/Skip/Take/Select/Include+ThenInclude (relationship-inferred eager load) and async terminals (ToListAsync/CountAsync/FirstAsync/…); results are async-only
✅ Async‑first ValueTask<T> API, OpenAsync(...), await using (IAsyncDisposable), IProgress<T> callbacks
✅ Stream‑based I/O Open from any seekable Stream (files, byte arrays, blobs, embedded resources)
✅ Encryption Read/update built-in JET RC4 and ACE CryptoAPI, Standard AES and Agile AES; create JET RC4 or ACE Agile AES and maintain passwords. See Encryption Support for provider and platform scope.
✅ Schema features Create, rename and drop tables, columns and indexes; selectable text collations; defaults, validation and empty-string constraints; primary & foreign keys with cascade update/delete; linked tables. See schema scope.
✅ Complex columns Read, add, replace and remove attachments and multi-value items with native item IDs; maintain append-only Memo history (ACCDB)
✅ Calculated columns Native ACCDB expressions, metadata and cached values; recompute dependent results on insert/update and populate newly added fields, with native error values and regional settings. See calculated fields.
✅ Concurrency .ldb / .laccdb lockfile + BCL page-level byte-range locks where supported
✅ Transactions Group or nest changes with CommitAsync / RollbackAsync; file transactions recover after process crashes (see guarantees)
✅ Storage maintenance Access-style free-page reuse, free-page scrubbing, opt-in secure erase, tail shrinking, and AccessDatabaseCompact managed compaction and bounded repair
✅ Performance Configurable CLOCK page cache with approximate LRU eviction, default parallel read-ahead for eligible page scans, streaming row APIs

Security

The parser enforces bounds on several page, long-value, attachment and encryption paths. Hostile-file auditing and fuzz coverage remain ongoing; the CVE review is a threat-model inventory, not proof that every attack surface is mitigated. See the security work and the vulnerability review.

Access/text linked data requires a LinkedSourceResolver that supplies an authorized stream. The library reads that exact stream without opening catalog paths or filename-derived sidecars; see linked-source configuration.


Correctness

The test suite draws from and extends the coverage of Jackcess, mdbtools, OpenMcdf, and Microsoft's Extensible Storage Engine for analogous storage-engine risk categories, with additional coverage for corner cases, corruption resilience, and format variants.

Access compatibility is checked with Microsoft-authored fixtures and DAO tests. Coverage is incomplete; see the writer disk-format validation matrix for tested formats and native-engine results, and the open requirements for remaining work.

Beyond functional tests, the codebase is validated by:

  • Strict compiler settings — Nullable reference types, warnings-as-errors, WarningLevel 9999, AnalysisLevel latest-all and arithmetic overflow checks apply globally.

  • Static analysis — Roslyn .NET analyzers, Roslynator, StyleCop and .editorconfig code-style rules are enforced as errors in Release library and test builds on every push to main and every pull request.

  • Verified recovery and parsing kernels — Production recovery and value parsing use generated Dafny code for bounded journal framing, replay identity, replacement field validation, byte authorization and long-value descriptor codecs. Separate models check selected undo, interrupted recovery, replacement and generation-ownership invariants for arbitrary finite model instances. CI verifies proofs, audits trust and checks generated freshness. Remaining C# correspondence and operating-system persistence are separate obligations. No verifier or solver ships with the library.

  • Continuous integration — Every push to main and every pull request runs the CI gate. Content selection requires Release builds, Windows tests of the native build on .NET 11 and the netstandard2.1 build on .NET 10 and .NET 11 when their inputs change; unchanged lanes retain validated ancestor evidence. Release tags run every lane and publish that run's tested package only after the required release evidence passes.

  • Reproducible builds — Deterministic compilation via DotNet.ReproducibleBuilds; reproducing builds requires matching locked dependencies, SDK, version and build inputs.

  • Access Compact & Repair checks — DAO-guarded tests cover tables, indexes, relationships and complex values; the validation matrix lists the tested revision, native-engine results and unresolved gaps.

  • Index key fixture parity — Access-authored fixtures validate long text/MEMO index keys with embedded line breaks: Jet4 (V2000 / V2003 / V2007) is byte-exact; V2010 ACE is byte-exact for the checked-in Table11 / Table11_desc long rows. The V2010 encoder includes DAO-derived 65-character contribution tables for plain, auxiliary, row10, row11 and row12 long-row suffix contexts. Probes found zero mismatches across exported matrices and observed double-space sweeps. See GeneralLegacyEncoderFixtureTests.cs and GeneralEncoderFixtureTests.cs.

  • Fuzz testing — An explicit hosted workflow runs deterministic corpus mutations and truncations under per-process time and memory limits, retaining failure reproductions and logs.

  • Memory safety analysis — InferSharp v1.5 analyzes both library targets in its own workflow, available only by manual dispatch (gh workflow run infersharp.yml --ref main). Unreviewed findings or empty translation fail the lane; partial method translation limits coverage. Text and SARIF reports and translation coverage are retained as infersharp-<framework> artifacts. The reviewed exceptions identify exact false positives, document ownership or synchronization evidence and pin reviewed source hashes. New findings, changed reviewed source or obsolete exceptions fail the gate.


Quick Start

Installation

dotnet add package JetDatabaseWriter
Install-Package JetDatabaseWriter

NuGet target compatibility

The package targets .NET 11 (net11.0) and .NET Standard 2.1. Applications on .NET Core 3.x and .NET 5–10 use the .NET Standard build; .NET Framework is not supported. See runtime and NativeAOT guidance for details.

Reading Data

Open an existing database, list its tables, and read rows into a small C# model. This example expects an Orders table; change the path, table name and properties to match your file.

using JetDatabaseWriter;

await using var reader = await AccessReader.OpenAsync("database.mdb");

var tables = await reader.ListTablesAsync();
Console.WriteLine($"Tables: {string.Join(", ", tables)}");

var orders = await reader.ReadTableAsync<Order>("Orders", maxRows: 100);
foreach (var order in orders)
    Console.WriteLine($"#{order.OrderID}: {order.Freight:C}");

public class Order
{
    public int OrderID { get; set; }
    public decimal Freight { get; set; }
}

Properties match column names without regard to case. For large tables, stream rows with await foreach (var order in reader.Rows<Order>("Orders")) instead of loading a list. The reading guide covers filtering, indexes, relationships, attachments and other column types.

Writing Data

Create a new database and insert a row using column names. The destination file must not already exist.

using JetDatabaseWriter;
using JetDatabaseWriter.Enums;
using JetDatabaseWriter.Models;

await using var writer = await AccessWriter.CreateDatabaseAsync(
    "contacts.mdb", DatabaseFormat.Jet4Mdb);

await writer.CreateTableAsync("Contacts", new[]
{
    new ColumnDefinition("Id", typeof(int)) { IsPrimaryKey = true },
    new ColumnDefinition("Name", typeof(string), maxLength: 100),
});

await writer.InsertRowAsync("Contacts", new RowValues
{
    ["Id"] = 1,
    ["Name"] = "Alice",
});

To edit an existing file, open it with AccessWriter.OpenAsync("contacts.mdb"). Use one writer per file and dispose it when finished; await using does this automatically. The writing guide covers updates, deletes, schema changes and constraints, and the operations guide explains transactions.

Entity Framework Core

Install JetDatabaseWriter.EntityFrameworkCore to use EF Core 10 on .NET 10 or .NET 11. The provider reads and writes Access files directly, without native drivers:

using JetDatabaseWriter.EntityFrameworkCore.Extensions;
using Microsoft.EntityFrameworkCore;

var options = new DbContextOptionsBuilder<MyContext>()
    .UseJetDatabaseWriter("application.accdb")
    .Options;
await using var context = new MyContext(options);
await context.Database.EnsureCreatedAsync();
await context.SaveChangesAsync();

Use asynchronous persistence and transaction APIs. Queries support async and synchronous enumeration. MigrateAsync adds missing schema objects and seed rows; it does not run versioned EF migrations or alter existing columns. The EF provider guide covers a complete model, configuration, owned values, transactions, seeding and query diagnostics.

Documentation

See PLAN.md for open work, dependencies and acceptance criteria across all workstreams, including formal verification.

I want to… Guide
Read, filter or stream data Reading and querying
Insert or edit data and change schemas Writing data
Use streams, configure options or handle failures Database operations
Generate C# models from an existing database Scaffolding
Use EF Core models, tracking and relationships Entity Framework Core
Understand Access terminology and file formats Glossary and design notes
Assess recent proofs and algorithms against this library Proof and algorithm survey

Encryption Support

Pass a password when opening a protected database:

using JetDatabaseWriter;

await using var reader = await AccessReader.OpenAsync(
    "protected.accdb", new AccessReaderOptions("your-password"));

Writers accept the password through AccessWriterOptions.

Format Current support
Jet4 password protection and RC4 encryption Read, update, create, encrypt/decrypt and change passwords, including native security identity remasking and rebuilding indexed Owner/SID fields.
ACE Agile encryption Read and update AES-128/192/256 with CBC or CFB8 and SHA-1/256/384/512; create and maintain using AES-256-CBC/SHA-512. Microsoft-compacted fixtures cover AES-192, CFB8, SHA-256 and SHA-384 as well as the default algorithms, including distinct password and page parameters.
Jet3 RC4 encryption and password protection Native code-page passwords, page updates and maintenance; DAO 3.6 fixtures and read/write/compact checks cover Access 97.
ACE Standard and RC4 CryptoAPI providers Read and update native pages, including 50,000-iteration Standard and compatibility AES. Microsoft DAO read/write/compact checks and a native Standard output fixture verify interoperability.

AccessWriter.CreateDatabaseAsync encrypts a new database when AccessWriterOptions.Password is nonempty, before writing the initial database image. Use AccessDatabaseEncryption.EncryptAsync, DecryptAsync and ChangePasswordAsync for file maintenance. These fully managed operations stream pages into an adjacent temporary file and replace the original after successful completion. Use a containing directory protected from untrusted access; see maintenance permissions and durability. Ordinary updates preserve the original encryption provider and key. Password maintenance preserves JET password-only mode; ACE password changes use fresh AES-256-CBC/SHA-512 encryption.

The support status covers the built-in providers listed above. Third-party extensible providers, non-AES Agile ciphers and Office encrypted compound packages are not supported database inputs. Custom workgroup identities are preserved; the library does not authenticate workgroup users. See the native encryption evidence for fixture provenance and the encryption options for resource limits, replacement recovery and platform durability limits.

Limitations

  • Keep the file stable while reading, and use one writer per file. A reader caches data and does not refresh it or provide a consistent snapshot of a changing file. Reopen it after changes. Lockfiles help coordinate access but do not exclude every external writer on every platform.
  • Crash recovery requires the database and its journal. File transactions and physical shrinking recover interrupted writes on writer reopen; keep the adjacent .jdw-journal with the database until recovery finishes. Custom streams provide live rollback under the caller-stream contract; power-loss guarantees remain unqualified. See transaction guarantees.
  • Access feature coverage varies. Third-party encryption providers, some index formats and some expressions are unsupported. For example, a default or validation rule using DLookUp refuses the write. See the compatibility evidence and detailed limits.
  • Access size and encoding constraints still apply. Tables are limited to 255 columns; rows must fit the supported page layout. Jet3 text must fit the database's code page. Large MEMO and binary OLE values can use separate pages; see size limits.
  • Storage maintenance has explicit bounds. AccessDatabaseCompact rebuilds local tables, long values, indexes and usage maps into a validated database and reclaims proven table storage while keeping TDEF page identities and opaque/ambiguous pages pinned; partial recovery never authorizes in-place replacement. ShrinkDatabaseAsync removes free pages at the end of a file in place. Deleted data is not securely erased by default; see storage maintenance and Compact & Repair.
  • This is a data library. It supports LINQ queries, but does not execute SQL, saved Access queries, forms, reports, macros or VBA, and does not provide an ODBC driver. Complete preservation of Access application objects during edits is not established.

How It Works

JetDatabaseWriter reads and writes the database's pages directly: the catalog identifies tables, table definitions describe columns and indexes, and data pages hold rows. Large values use separate page chains. See the library structure and format notes for the details.

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for setup, development and validation guidance.

License

MIT — see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JetDatabaseWriter:

Package Downloads
JetDatabaseWriter.EntityFrameworkCore

Pure-managed Entity Framework Core provider for Microsoft Access JET/ACE databases (.mdb/.accdb) powered by JetDatabaseWriter. No OleDB, ODBC, or ACE drivers required.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 863 11/10/2026
1.0.0 117 11/3/2026