Using macOS with Access 2002 + ODBC.
<PackageReference Include="System.Data.Odbc" Version="5.0.0" />
<PackageReference Include="EntityFrameworkCore.Jet" Version="3.1.0-alpha.3" />
<PackageReference Include="EntityFrameworkCore.Jet.Odbc" Version="3.1.0-alpha.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.10" />
ODBC + Drives are installed/working via:
+ brew install unixODBC
+ brew install mdbtools --with-unixODBC
I'm using isql -k "connection-string-goes-here" to make sure Access JET4 database can read from tables or queries.
What am I running into
Inside the OnConfiguring(optionsBuilder) method of my DbContext .UseJetOdbc(connection_string) always produces errors.
optionsBuilder.UseJetOdbc(@"Driver={Microsoft Access Driver (*.mdb)};DBQ=/Users/p_m_/Desktop/access-db/open-data/Electronics-Sales.mdb;")
The error this produces
Could not find DSN nor DBQ in connect string
+ When using `isql` DBQ must be capitalized in order to recognize it as the DBQ
+ Using the string exactly above - breaks in dotnet / but works using isql
+ The Driver is just named as-is-above in the unixODBC configuration files which is why it matches Windows XP
The connection parameter must be of type JetConnection.
To get around this, we tried creating a demo project using only System.Data.Odbc
<PackageReference Include="System.Data.Odbc" Version="5.0.0" />
In that demo, we use OdbcConnectionStringBuilder with OdbcConnection to access our Access Office XP database. This works, even on macOS with .dylib patched in ODBC Drivers.
What can I do to get UseJet()/UseJetOdbc() to use my OdbcConnection?
Here the missing link to Accdb + EF Core + Unix + OData + ASP .NET Core looks to be a connection sanitization bias.
- Does
UseJetOdbc() lowercase attributes like DBQ which are case-sensitive on Unix?
- EF Core Jet asks for a connection string, filename, or
OdbcConnection.
- Is there a special version of
OdbcConnection that doesn't derive from System.Data.Odbc?
I have EntityFrameworkCore.Jet.Odbc in my project - this case is not urgent, please take your time.
Using macOS with Access 2002 + ODBC.
ODBC + Drives are installed/working via:
I'm using
isql -k "connection-string-goes-here"to make sure Access JET4 database can read from tables or queries.What am I running into
Inside the
OnConfiguring(optionsBuilder)method of my DbContext.UseJetOdbc(connection_string)always produces errors.The error this produces
The connection parameter must be of type JetConnection.
To get around this, we tried creating a demo project using only
System.Data.OdbcIn that demo, we use
OdbcConnectionStringBuilderwithOdbcConnectionto access our Access Office XP database. This works, even on macOS with.dylibpatched in ODBC Drivers.What can I do to get
UseJet()/UseJetOdbc()to use myOdbcConnection?Here the missing link to Accdb + EF Core + Unix + OData + ASP .NET Core looks to be a connection sanitization bias.
UseJetOdbc()lowercase attributes likeDBQwhich are case-sensitive on Unix?OdbcConnection.OdbcConnectionthat doesn't derive fromSystem.Data.Odbc?I have
EntityFrameworkCore.Jet.Odbcin my project - this case is not urgent, please take your time.