EntityframeworkCore How to connect with odbc driver

Andrew Hsiao 1 Reputation point
2021-08-06T00:59:07.33+00:00

hello
I had success get the access driver by
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=abc.accdb" ConnectionString
now I want to use odbc driver to connect access

use connectionstring is
string odbcstr = "Driver={Microsoft Access Driver (*.mdb)};dbq=d:\123.mdb"
but fail ,

where do I get any resource data connection sample ?
DbContextOptionsBuilder class
optionsBuilder.UseJet(odbcstr,OdbcFactory.Instance)

Developer technologies | .NET | Entity Framework Core
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,656 Reputation points
    2021-08-06T05:33:55.57+00:00

    Hi AndrewHsiao-6094,
    From the following threads, you can know that Entity Framework doesn't support ODBC.
    Why doesn't Entity Framework support ODBC?
    Is there a way to use ODBC with EF?
    And this document provides information on data providers that support the Entity Framework.
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.