Delly.DBunny.MsAccess
2026.5.7
dotnet add package Delly.DBunny.MsAccess --version 2026.5.7
NuGet\Install-Package Delly.DBunny.MsAccess -Version 2026.5.7
<PackageReference Include="Delly.DBunny.MsAccess" Version="2026.5.7" />
<PackageVersion Include="Delly.DBunny.MsAccess" Version="2026.5.7" />
<PackageReference Include="Delly.DBunny.MsAccess" />
paket add Delly.DBunny.MsAccess --version 2026.5.7
#r "nuget: Delly.DBunny.MsAccess, 2026.5.7"
#:package Delly.DBunny.MsAccess@2026.5.7
#addin nuget:?package=Delly.DBunny.MsAccess&version=2026.5.7
#tool nuget:?package=Delly.DBunny.MsAccess&version=2026.5.7
Delly.DBunny.MsAccess
Microsoft Access provider implementation for DBunny. Supports both modern .accdb (ACE 12.0+) and legacy .mdb (Jet 4.0) formats.
Windows Only: This provider requires Windows as it depends on Microsoft Access Database Engine (OLE DB), which is not available on other platforms.
Installation
dotnet add package Delly.DBunny.MsAccess
Prerequisites
For Access database connectivity, you need to have one of the following installed on your system:
For .accdb (Access 2007+): Microsoft Access Database Engine 2016 Redistributable
- Download from Microsoft
- Provider:
Microsoft.ACE.OLEDB.12.0
For .mdb (Access 2003): Jet 4.0 (included with Windows) or ACE driver
- Provider:
Microsoft.Jet.OLEDB.4.0(32-bit only, requires 32-bit application)
- Provider:
Note: The application's bitness must match the installed Access driver. Use 32-bit build for Jet 4.0 compatibility.
Quick Start
using Delly.DBunny;
using Delly.DBunny.MsAccess;
using Delly.DBunny.Sql.Extension;
using System.Data.Common;
// Create provider (default uses ACE for .accdb)
var provider = new MsAccessProvider();
var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=mydb.accdb;";
using var connection = provider.GetDbConnection(connectionString);
connection.Open();
// Create a table
var columnDescriptors = new List<DbColumnDesciptor>
{
new DbColumnDesciptor { ColumnName = "Id", ColumnType = "COUNTER", PrimaryKeyFlag = true, NullableFlag = false },
new DbColumnDesciptor { ColumnName = "Name", ColumnType = "VARCHAR(100)", PrimaryKeyFlag = false, NullableFlag = false },
new DbColumnDesciptor { ColumnName = "Age", ColumnType = "INTEGER", PrimaryKeyFlag = false, NullableFlag = true }
};
var createTableSql = provider.SqlProvider.CreateTable(string.Empty, "Users", columnDescriptors);
using var createCommand = provider.GetDbCommand(connection);
createCommand.CommandText = createTableSql.Sql;
await createCommand.ExecuteNonQueryAsync();
// Insert data
var insertSql = new Sqled("INSERT INTO [Users] (Name, Age) VALUES (?, ?)")
.Set("name", "John Doe")
.Set("age", 30);
using var insertCommand = provider.GetDbCommand(connection);
insertCommand.CommandText = insertSql.Sql;
provider.SetParameters(insertCommand, insertSql.Parameters);
await insertCommand.ExecuteNonQueryAsync();
// Query data
var selectSql = new Sqled("SELECT * FROM [Users] WHERE Age > ?")
.Set("minAge", 18);
await provider.ReadAsync(connection, selectSql, async reader =>
{
while (await reader.ReadAsync())
{
var id = reader["Id"];
var name = reader["Name"];
var age = reader["Age"];
Console.WriteLine($"Id: {id}, Name: {name}, Age: {age}");
}
});
Connection Builder
Use the fluent builder for connection configuration:
using Delly.DBunny.MsAccess;
using Delly.DBunny.Connecting.Extension;
// For modern .accdb files (ACE 12.0)
var connectionDefine = new MsAccessConnectionDefine()
.WithDataSource("mydb.accdb")
.WithProviderAce()
.WithPooling(false)
.WithReadWrite()
.WithConnectionTimeout(15)
.WithDefaultCommandTimeout(30);
// For legacy .mdb files (Jet 4.0 - 32-bit only)
var legacyConnectionDefine = new MsAccessConnectionDefine()
.WithDataSource("mydb.mdb")
.WithProviderJet()
.WithPooling(false);
var descriptor = connectionDefine.GetDbConnectionDescriptor(
MsAccessConnectionDefine.DATABASE_TYPE, "Default");
var connectionString = descriptor.ConnectionString;
Connection Parameters
| Parameter | Default | Description |
|---|---|---|
| Provider | Microsoft.ACE.OLEDB.12.0 | OLE DB provider (ACE or Jet) |
| Data Source | - | Database file path (.accdb or .mdb) |
| Jet OLEDB:Database Password | - | Database password |
| Persist Security Info | False | Persist security info |
| Mode | Share Deny None | Access mode (Share Deny None, Share Exclusive, Read, Read Write) |
| Connect Timeout | 15 | Connection timeout in seconds |
| Default Command Timeout | 30 | Command timeout in seconds |
| OLE DB Services | -1 | Enable OLE DB services (-1 = all services enabled, 0 = disabled) |
| Min Pool Size | 0 | Minimum pool size |
| Max Pool Size | 100 | Maximum pool size |
Access-Specific Considerations
File Formats
- .accdb: Modern Access format (2007+), requires ACE 12.0+ provider
- .mdb: Legacy format (2003 and earlier), requires Jet 4.0 or ACE provider
Access Mode Options
- Share Deny None: Default, allows shared read/write access
- Share Deny Read: Others can write but not read
- Share Deny Write: Others can read but not write
- Share Exclusive: Exclusive access for this user
- Read: Read-only access
- Read Write: Read/write access
Limitations
- No Database Operations: Access databases are files, not servers
- No Schema Support: Access doesn't support schemas
- Positional Parameters: OleDb uses
?parameters (position-based, not named) - Name Quoting: Uses square brackets
[name] - AUTOINCREMENT/COUNTER: For auto-incrementing primary keys
- No Column Rename: Access doesn't support renaming columns directly
- No Column Modify: Access doesn't support modifying column types directly
Type Mapping
| .NET Type | Access Type | Notes |
|---|---|---|
| Boolean | BIT | - |
| Byte, SByte, Int16, UInt16, Int32, UInt32 | INTEGER | - |
| Int64, UInt64 | LONG | - |
| Single, Double | DOUBLE | - |
| Decimal | CURRENCY | Currency precision |
| DateTime | DATETIME | - |
| Char | CHAR(1) | Fixed-length 1 character |
| String (<=255 chars) | VARCHAR(n) | Variable-length |
| String (>255 chars) | LONGTEXT | Memo/long text |
Supported Operations
- ✅ Create/Drop tables
- ✅ Add/Drop columns
- ✅ Create/Drop indexes
- ✅ Query/Insert/Update/Delete data
- ✅ Transactions
- ❌ Rename columns (not supported by Access)
- ❌ Modify column types (not supported by Access)
- ❌ Multiple databases (file-based only)
Workarounds
Rename Column: Create a new column, copy data, drop the old column
// 1. Add new column
await ExecuteNonQueryAsync(connection, "ALTER TABLE [Users] ADD COLUMN [NewName] VARCHAR(100);");
// 2. Copy data
await ExecuteNonQueryAsync(connection, "UPDATE [Users] SET [NewName] = [OldName];");
// 3. Drop old column
await ExecuteNonQueryAsync(connection, "ALTER TABLE [Users] DROP COLUMN [OldName];");
Modify Column Type: Create a new table with the new schema, copy data, drop old table
Known Issues
- Column metadata from
MSysObjectsandINFORMATION_SCHEMAmay have limited information - Primary key detection requires additional queries beyond the basic
GetColumnsimplementation - Index uniqueness information is not fully exposed through system tables
Dependencies
This provider uses .NET's built-in System.Data.OleDb - no additional NuGet packages required.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. 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 is compatible. 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 was computed. |
| .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
- Delly.DBunny.Core (>= 2026.5.7)
- System.Data.OleDb (>= 8.0.0)
-
net5.0
- Delly.DBunny.Core (>= 2026.5.7)
- System.Data.OleDb (>= 8.0.0)
-
net8.0
- Delly.DBunny.Core (>= 2026.5.7)
- System.Data.OleDb (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.