-1

I want to develope one application in C# under Visual Studio and I pretend to use Entity Framework with two Access DBs (with accdb extension). I found the JetEntityFrameworkProvider project developed by Umberto Ballestrazzi(Alias Bubi), I saw the video which explain all the process to get working on Visual Studio but I don't get It. One of the steps requires to Download and Compile the project, but the pre and post compile commands fail with the following messages:

Error Command "call "D:\Microsoft Visual Studio\2019\Community\Common7\IDE..\Tools\vsvars32.bat" gacutil /u JetEntityFrameworkProvider.dll" exited with code 9009. Project: JetDdexProvider.

Error Command ""%ProgramFiles%\Microsoft SDKs\Windows\v8.0A\Bin\NETFX 4.0 Tools\gacutil.exe" /u "JetEntityFrameworkProvider"" exited with code 3. Project: JetEntityFrameworkProvider.

Following the video indications I've Downloaded JetEntityFrameWorkProvider and DDEX-Deserialiser Nugets. I've manually added the machine.config entry, I've changed vsvars32.bat to vsdevcmd.bat as some other threads suggested and I don't get to progress.

How can I get to work it in order to create and EDMX diagram with Access Provider? Can I use It with Access versions 2007 or 2010, MDBs and ACCDBs?

Things to keep in care:

  • I want to use with Visual Studio 2019, all solutions I found where for Visual Studio Community 2017 or before, If there's no more way i could Downgrade to 2017 if that could solve the problem, but I prefer to use 2019.

  • I've downloaded JetEntityFrameWorkProvider Version 6.2.0-rc1 and DDEX-Deserialiser Version 3.7.0 Nugets.

  • I've followed the indications of this link posted by Bubi to explain the process: https://www.youtube.com/watch?v=XHrpY_nMXrk

Thanks in advance for your time and help.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

2 Answers2

0

Go to NuGet packages and search fore JetEntityFramework when you install it all you need is to add to your app.config file this connection string

 <connectionStrings>
<add name="Baza" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\test.accdb" providerName="JetEntityFrameworkProvider" />

D:\test.accdb is the location of the file if you want to be in the directory the same as your app just use |DataDirectory|\test.accdb works perfectly fine for me.

0

Check out the visual-studio-201x-version

of this repo https://github.com/aspdotnetgabs/sharpdevelopmvc. It has all the things you need to use JetEntityFrameworkProvider for Entity Framework 6.

It already has the following:

packages.config

<package id="JetEntityFrameworkProvider" version="6.2.0-rc1" targetFramework="net452" />

csproj

<PlatformTarget>x86</PlatformTarget>

web.config

<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameters>
            <parameter value="v13.0" />
        </parameters>
    </defaultConnectionFactory>
    <providers>
        <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />           
        <provider invariantName="JetEntityFrameworkProvider" type="JetEntityFrameworkProvider.JetProviderServices, JetEntityFrameworkProvider" />
    </providers>
</entityFramework>

<system.data>
    <DbProviderFactories>
        <add name="Jet Entity Framework Provider" invariant="JetEntityFrameworkProvider" description="Jet Entity Framework Provider" type="JetEntityFrameworkProvider.JetProviderFactory, JetEntityFrameworkProvider" />
    </DbProviderFactories>
</system.data>

Connection String

<add name="MyAccessDb" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyAccessDb.mdb" providerName="JetEntityFrameworkProvider" />

and a pre-configured/tweak blank MDB file

/App_Data/MyAccessDb.mdb

I created this template project in Visual Studio 2019 so I think you are good to go.

hubert17
  • 285
  • 5
  • 8