Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Open Access 365 Database

Open Access 365 Database

Scheduled Pinned Locked Moved Database
helpcsharpdatabasecomquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I'm trying to open an Access 365 database in C#

    private void LoadDatabase(string fileName)
    {
    var connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.16.0;Data Source={0}", fileName);

    DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
    
    DataTable userTables = null;
    
    using (DbConnection connection = factory.CreateConnection())
    {
        // c:\\test\\test.mdb
        connection.ConnectionString = connectionString;
            
        // We only want user tables, not system tables
        string\[\] restrictions = new string\[4\];
        restrictions\[3\] = "Table";
    
        connection.Open();
    
        // Get list of user tables
        userTables = connection.GetSchema("Tables", restrictions);
    }
    

    }

    On the Open line I get

    "The 'Microsoft.ACE.OLEDB.16.0' provider is not registered on the local machine"

    I've been Googling this and just about every result says to get the Access 2007 or 2010 driver(s) from [here](https://www.microsoft.com/en-us/download/details.aspx?id=13255), which I did. I still get the error. Anyone know what's wrong?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups