Open Access 365 Database
Database
1
Posts
1
Posters
1
Views
1
Watching
-
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.