3

Is it possible to create Entity Data Model (edmx file) from MS Access Database mdb file? If yes then how? I have tried using Entity Data Model Wizard, but there I could only choose sql databases.

I have website in MVC3 and I need to connect it to dsatabase that is in mdb file.

Any help much appreciated!

Marta
  • 2,857
  • 13
  • 46
  • 67
  • 1
    Just to feed my curiosity; why on earth are you using MS Access? And by the way; I don't think entity framework supports ms access "databases". Port it to sql server instead and forget you ever had this problem :-) – Marius Oct 19 '11 at 13:00
  • Although [this](http://stackoverflow.com/questions/1132720/entity-framework-with-oledb-connection-am-i-just-plain-nuts) question is a bit dated, I'm tempted to say you can't do it. – Roman Oct 19 '11 at 13:04
  • possible duplicate of [Entity framework join to ms-access](http://stackoverflow.com/questions/4778825/entity-framework-join-to-ms-access) – Roman Oct 19 '11 at 13:04
  • If I had a choice, I would never choose to use ms access "databases". But I get this database with tables and data and now I have to do something with it ... – Marta Oct 19 '11 at 13:22
  • 1
    SQl Server can could link to the Access file or you could just import all the tables. – JeffO Oct 19 '11 at 17:53

2 Answers2

6

you are right, I was expecting to have also OLEDB or ODBC listed but there is only SQL Server and SQL Server Compact. Anyway if you are doing serious development at minimum use SQL Express or SQL Compact, both free and probably way better than old MS Access.

With the latest version of SQL Compact (4), it runs also in IIS and with Partial Trust so you can use it without any issue with your Hosting Provider, in case you do not want to pay for SQL connectivity.

like you find here: Microsoft SQL Server Compact 4.0

Enabled to work in the medium or partial trust environments in the web servers, and can be easily deployed along with the website to the third party website hosting service providers.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • It is not really my choice to use MS Access DB. I get mdb file with tables and data and now I have to do something with it. – Marta Oct 19 '11 at 13:24
  • then use old good ADO.NET without EF. Or import those tables into SQL Express or Compact. – Davide Piras Oct 19 '11 at 13:27
  • @DavidePiras Maybe he could link the tables from the Access database to a copy in SQL Server. Correct me if I'm wrong, but I think it should work, right? – Igor May 14 '14 at 14:56
4

MS Access is not supported by EF.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670