Access.Data.AccessClient
1.0.0.26270
dotnet add package Access.Data.AccessClient --version 1.0.0.26270
NuGet\Install-Package Access.Data.AccessClient -Version 1.0.0.26270
<PackageReference Include="Access.Data.AccessClient" Version="1.0.0.26270" />
<PackageVersion Include="Access.Data.AccessClient" Version="1.0.0.26270" />
<PackageReference Include="Access.Data.AccessClient" />
paket add Access.Data.AccessClient --version 1.0.0.26270
#r "nuget: Access.Data.AccessClient, 1.0.0.26270"
#:package Access.Data.AccessClient@1.0.0.26270
#addin nuget:?package=Access.Data.AccessClient&version=1.0.0.26270
#tool nuget:?package=Access.Data.AccessClient&version=1.0.0.26270
Access.Data.AccessClient
Fully managed ADO.NET data provider for Microsoft Access databases (.mdb, .accdb).
Reads and writes the database file directly: no ACE/Jet, OLE DB, ODBC or native code, so it runs anywhere .NET runs
(Windows, Linux, macOS, x86/x64/ARM).
The API contains: AccessConnection, AccessCommand, AccessDataReader,
AccessParameter, AccessDataAdapter, AccessCommandBuilder, AccessTransaction, AccessClientFactory.
Reads and writes: queries, INSERT/UPDATE/DELETE, DDL, transactions and CreateDatabase. Files written by the
provider are laid out the way ACE/Jet write them and are verified by reading them back, modifying and compacting them
with Microsoft's engines.
Supported formats
AccessFileFormat |
File | Access version |
|---|---|---|
Jet3 |
.mdb |
Access 97 |
Jet4 |
.mdb |
Access 2000–2003 |
Ace12 |
.accdb |
Access 2007 |
Ace14 |
.accdb |
Access 2010 |
Ace16 |
.accdb |
Access 2016 (Large Number) |
Ace17 |
.accdb |
Access 2019+ (Date/Time Extended) |
Password-protected / encrypted files (read and write): Jet RC4, Office RC4 CryptoAPI, Agile AES, CryptoAPI AES; ECMA-376 Standard AES is read-only.
Targets netstandard2.0 and netstandard2.1 (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+).
Install
dotnet add package Access.Data.AccessClient
Quick start
using Access.Data.AccessClient;
using var conn = new AccessConnection(@"Data Source=C:\data\Northwind.accdb;Read Only=True");
conn.Open();
using var cmd = new AccessCommand(
"SELECT ProductName, UnitPrice FROM Products WHERE UnitPrice > @minPrice ORDER BY ProductName", conn);
cmd.Parameters.AddWithValue("@minPrice", 20m);
using var reader = cmd.ExecuteReader();
while (reader.Read())
Console.WriteLine($"{reader.GetString(0)}: {reader.GetDecimal(1)}");
Write, inside a transaction:
AccessConnection.CreateDatabase(@"C:\data\People.accdb"); // format from the extension (.accdb → Ace16)
using var db = new AccessConnection(@"Data Source=C:\data\People.accdb");
db.Open();
using (var ddl = new AccessCommand("CREATE TABLE People (Id COUNTER PRIMARY KEY, Name TEXT(50) NOT NULL)", db))
ddl.ExecuteNonQuery();
using var tx = db.BeginTransaction();
using var insert = new AccessCommand("INSERT INTO People (Name) VALUES (@name)", db, tx);
insert.Parameters.AddWithValue("@name", "Ada");
insert.ExecuteNonQuery();
tx.Commit();
Fill a DataTable:
var table = new DataTable();
new AccessDataAdapter("SELECT * FROM Customers", conn).Fill(table);
Other command types:
CommandType |
CommandText |
|---|---|
Text |
Access SQL; several statements separated by ; |
StoredProcedure |
Name of a saved query; runs with Parameters |
TableDirect |
Table name (or comma list) read whole |
Parameters: named (@p, :p) or positional (?).
Connection string
Keywords are case-insensitive; OLE DB / ODBC connection strings paste unchanged (unknown provider-only keywords
such as Provider, Driver, User ID, Jet OLEDB:* are accepted and ignored).
| Keyword (synonyms) | Default | Meaning |
|---|---|---|
Data Source (DBQ, Database, DataSource, FileName) |
— | Path to the file; \|DataDirectory\| is expanded |
Password (PWD, Jet OLEDB:Database Password) |
— | Database password |
Read Only |
false |
Open read-only |
Mode |
— | OLE DB mode (Read, Share Exclusive, …) |
Exclusive |
false |
Whole-file exclusive lock |
Journal |
true |
Crash-safe commits through a before-image journal (<file>.acj, replayed at the next open) |
LIKE Mode |
Access |
Access (*, ?, #) or Ansi (ANSI-92: %, _) wildcards |
Command Timeout |
30 |
Default AccessCommand.CommandTimeout (s) |
Connect Timeout |
15 |
Reported by ConnectionTimeout (s) |
Use AccessConnectionStringBuilder to build them in code.
Data types
| Access type | AccessDbType |
CLR type |
|---|---|---|
| Yes/No | Boolean |
bool |
| Number (Byte / Integer / Long / Single / Double) | Byte / Short / Long / Single / Double |
byte / short / int / float / double |
| Number (Decimal), Currency | Decimal, Currency |
decimal |
| Large Number | BigInt |
long |
| Date/Time, Date/Time Extended | DateTime, DateTimeExtended |
DateTime |
| Short Text, Long Text | Text, Memo |
string |
| Binary, OLE Object | Binary, OleObject |
byte[] |
| Replication ID | Guid |
Guid |
| AutoNumber | AutoNumber |
int |
| Attachment / multi-value | Complex |
AccessAttachment[] / object[] |
Access SQL
Own Access SQL engine: SELECT with joins, GROUP BY/HAVING, UNION, subqueries, TOP, TRANSFORM … PIVOT,
saved queries, and the built-in function library (text, math, date, conversion, IIf/Switch/Nz, Format).
DML: INSERT … VALUES / SELECT, SELECT … INTO, UPDATE, DELETE. DDL: CREATE/DROP TABLE,
ALTER TABLE ADD/DROP/ALTER COLUMN, ADD/DROP CONSTRAINT (PRIMARY KEY, UNIQUE, FOREIGN KEY … ON UPDATE/DELETE
CASCADE / SET NULL), CREATE/DROP INDEX.
Writes enforce what Access enforces: required fields, zero-length strings, field sizes, validation rules, defaults, AutoNumber, calculated fields, unique and primary indexes, referential integrity with cascades.
Metadata
conn.GetSchema(...) collections: MetaDataCollections, DataSourceInformation, DataTypes, Restrictions,
ReservedWords, Tables, Columns, Indexes, IndexColumns, ForeignKeys, Views, Procedures.
conn.FileFormat / conn.ServerVersion report the file's format.
Provider factory
AccessClientFactory.Register(); // registers under AccessClientFactory.InvariantName
DbProviderFactory f = AccessClientFactory.Instance;
Errors
All failures throw AccessException (DbException) with an AccessErrorCode (InvalidFormat, InvalidPassword,
Syntax, NameNotFound, UniqueViolation, Locked, ReadOnly, Timeout, …) plus TableName / ColumnName when known.
Safety and limits
"Refuse rather than corrupt": what cannot be written exactly the way Access expects throws NotSupportedException
instead of risking damage:
- text index keys of sort orders other than General / General Legacy (e.g. a Czech database: tables with text indexes, and new tables — the catalog is indexed by name);
- unknown column types or encryption schemes (the file opens read-only,
conn.IsReadOnly == true); - creating attachment / multi-value / calculated fields (writing their values is supported);
- setting a password on a Jet4
.mdb(Jet3.mdband.accdbpasswords are supported).
Concurrent writers: connections of one process are serialized; another process writing the same file (e.g. Access
itself, detected through its .ldb / .laccdb lock file) makes writes fail with AccessErrorCode.Locked.
| 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Encoding.CodePages (>= 8.0.0)
-
.NETStandard 2.1
- System.Text.Encoding.CodePages (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Access.Data.AccessClient:
| Package | Downloads |
|---|---|
|
Net4x.DapperLibrary.Access
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.26270 | 252 | 9/27/2026 |