Unreliable Microsoft.ACE.OLEDB.12.0. Excel import works sometimes

VicVP 0 Reputation points
2025-08-19T15:45:03.6166667+00:00

Hello

I have a query that works all the time, 100 % success. I have a second one, with a different Excel file, that works the first 2 or 3 times I run it in a row. After that, the next run will run indefinitely and any other attempt at running any Microsoft.ACE.OLEDB.12.0 query will encounter the same fate. Restarting the SQL instance is the only way to be able to run the import again.

query 1
Select * From OpenDataSource ( 'Microsoft.ACE.OLEDB.12.0','Data Source=C:\ExcelFile1.xlsx; Extended Properties="EXCEL 12.0 XML;HDR=YES"')...[Sheet1$]

query 2
Select * From OpenDataSource ( 'Microsoft.ACE.OLEDB.12.0','Data Source=C:\ExcelFile2.xlsx; Extended Properties="EXCEL 12.0 XML;HDR=YES"')...[Sheet1$]

My questions

  • Can we expect a fix in the Microsoft.ACE.OLEDB driver? It's the same issue with Microsoft.ACE.OLEDB.16.0
  • In the 2nd excel file, what makes the driver to crash? What correction should be done in the file?
SQL Server Database Engine
{count} votes

Answer accepted by question author
  1. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2025-08-19T18:49:39.8766667+00:00

    No, you can't expect a fix. The 12.0 driver is past end of life, and the 16.0 driver goes out of support in October.

    In another thread, there is a mention of installing MS 365 Access Runtime instead, but that is the context of SSIS, not OPENROWSET/OPENDATASOURCE.

    Personally, I've never like the idea of accessing Excel directly from SQL Server. All through the years, I've seen so many posts where people are having all sorts of problems. For one thing, Excel may get the idea of opening a window, and that does not play well with server program that does not have a desktop.

    My preference is to write a program that reads the Excel file and then writes to SQL Server. That may not be for everyone, but there is also the Export/Import wizard in SSMS.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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