13

In this forum here , someone mentions that Entity Framework does not work with Access (Jet DB - .mdb). However it seems that there is a provider for Jet DB as described here

Which makes me think that the only thing I need with Entity Framework is to define the follwing before I define the models:

<connectionStrings>  
    <add name="ProductContext"
         providerName="Microsoft.Jet.OLEDB.4.0"
         connectionString="Source=C:\mydatabase.mdb;Jet OLEDB:Database
                           Password=MyDbPassword;"/>
</connectionStrings> 

Does anyone know if Entity Framework works fine with Jet DB, I want to make sure it does before I start since my design document depends on this fact.

Thanks

1
  • 1
    That is provider for ADO.NET but not for EF (you need one more provider). MS Access is not supported. If you need local database use SQL Server CE or SQL Server Express. Commented Jun 25, 2012 at 21:15

2 Answers 2

17

Entity Framework does not support OLEDB connections, so your connection string will not work. It is practically impossible to get Entity Framework to collaborate with MS Access. You will either need to dump the MS Access part of your design, or the Entity Framework part.

The closest you could get using MS Access is using strongly typed datasets and Linq-to-DataSet http://msdn.microsoft.com/en-us/library/bb386977.aspx

Or, considering going with SQL Express instead (it's free) http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx

2
  • Do you know of any open-source providers written for jet db to work with Entity Framework? Thanks Commented Jun 25, 2012 at 21:12
  • There are none unfortunately. Like I said, you will have to abandon one of the elements of your design, MS Access or EF. Commented Jun 25, 2012 at 21:14
12

There is a MS Access EF 6.1 provider here
https://jetentityframeworkprovider.codeplex.com/

EDIT
Now the EF provider for Access is hosted on GitHub
https://github.com/bubibubi/JetEntityFrameworkProvider

1
  • 1
    "It supports code first but in its current release it does not support db first." nice work.
    – sendreams
    Commented Apr 23, 2015 at 2:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.