paulyoder / LinqToExcel

Use LINQ to retrieve data from spreadsheets and csv files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to specify ACE OLEDB provider version

0xfeeddeadbeef opened this issue · comments

There is a newer version of Access Database Engine available:

When installed, it registers a little bit different provider moniker: Microsoft.ACE.OLEDB.16.0 and LinqToExcel throws 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Documentation on the download page claims that you can connect using older moniker (version 12.0), but this is not true — it is a copy/paste error.

Maybe we could add a new property and/or constructor argument to ExcelQueryFactory class? Something like this:

new ExcelQueryFactory(DatabaseEngineVersion.Ace16)
// and
ExcelQueryFactory.DatabaseEngineVersion = DatabaseEngineVersion.Ace12

Also we can detect available provider using OleDbEnumerator and set default engine version accordingly (This one will be a little bit costly; maybe not a good idea).

has this update been made or is there a workaround until it's officially made? corporate had me upgrade to the 64-bit version of office 365 and in the process i was required to uninstall the 32-bit version of Microsoft.ACE.OLEDB.12.0. when i went to install the 64-bit version of the redistributable, only 16.0 is available. all my projects that uses LinqToExcel are broken.

@rchong1983 As a temporary workaround, you can fork this project and then search and replace all instances of the old moniker with new one in ExcelUtilities class.

@0xfeeddeadbeef thanks. i tried this but now it says that Microsoft.ACE.OLEDB.16.0 provider is not registered. this seems a common problem (according to google). i tried the snippet of code i found here [https://stackoverflow.com/questions/21594400/get-a-list-of-all-access-ace-oledb-drivers-installed-on-the-system] that lists the available ole db providers. 16.0 doesn't appear. (i've built to framework 4.6.) this must be a windows/office thing.

@rchong1983 Have you tried to build your project for x64 platform?

@rchong1983 This can be helpful: Can't use the Access ODBC driver or OLEDB provider outside Office Click-to-Run applications
This article claims, that Office 365 gets installed inside some kind of virtual environment and 3rd party applications can't use its ACE provider. Installing Access Database Runtime separately should solve the problem.

@0xfeeddeadbeef success!! thank you! that little note at the bottom about installing with the /quiet flag was what i was missing in my previous attempts to install the redistributable. one would think that /quiet would only hide the UI portions of the installer but apparently it does much more...as in actually allowing the install to be performed. very strange. thanks again!