JetDatabaseWriter 1.0.0
See the version list below for details.
dotnet add package JetDatabaseWriter --version 1.0.0
NuGet\Install-Package JetDatabaseWriter -Version 1.0.0
<PackageReference Include="JetDatabaseWriter" Version="1.0.0" />
<PackageVersion Include="JetDatabaseWriter" Version="1.0.0" />
<PackageReference Include="JetDatabaseWriter" />
paket add JetDatabaseWriter --version 1.0.0
#r "nuget: JetDatabaseWriter, 1.0.0"
#:package JetDatabaseWriter@1.0.0
#addin nuget:?package=JetDatabaseWriter&version=1.0.0
#tool nuget:?package=JetDatabaseWriter&version=1.0.0
JetDatabaseWriter
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
- Installation
- Features
- Quick Start
- Reading Data
- Writing Data
- Documentation
- Encryption Support
- Limitations
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, and tail shrinking |
| ✅ | 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-alland arithmetic overflow checks apply globally.Static analysis — Roslyn .NET analyzers, Roslynator, StyleCop and
.editorconfigcode-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.1build 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_desclong 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 asinfersharp-<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.
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 |
| 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-journalwith 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
DLookUprefuses 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 is limited.
ShrinkDatabaseAsyncremoves free pages at the end of a file; it does not perform a full Access Compact & Repair. Deleted data is not securely erased by default; see storage maintenance. - 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 | Versions 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. |
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.IO.FileSystem.AccessControl (>= 5.0.0)
- System.Linq.Async (>= 7.0.1)
- System.Text.Encoding.CodePages (>= 10.0.14)
-
net11.0
- No dependencies.
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.