“Unexpected error from external database driver (1). (Microsoft JET Database Engine)" after applying October security updates.
UPDATE: As informed, the security patches with the fix was rolled-out yesterday 11/14. We would request you to test this and verify that the issue is addressed. If not, please let us know. Please find the information below,
Windows 7/2008 R2
-Monthly Roll-up - https://support.microsoft.com/en-us/help/4048957/windows-7-update-kb4048957
-Security-only update - https://support.microsoft.com/en-us/help/4048960/windows-7-update-kb4048960
-Security-only update - https://support.microsoft.com/en-us/help/4048962/windows-server-2012-update-kb4048962
Windows 8.1 and 2012 R2
-Monthly Roll-up - https://support.microsoft.com/en-us/help/4048958/windows-81-update-kb4048958
-Security-only update - https://support.microsoft.com/en-us/help/4048961/windows-81-update-kb4048961
Windows 10 Fall (“November”) Update, version 1511
Windows 10 Anniversary Update, version 1607, and Server 2016
Windows 10 , version 1703
We have been seeing a recent influx in cases where the JET provider is no longer able to connect after the October update. This update (released October 10th, 2017) includes a security update release that inadvertently affects the JET provider. The update was kb4041678 and included in the patch kb4041681. These patches affected the Operating System, which adversely has an issue with the following technologies: Microsoft Windows Search Component, Windows kernel-mode drivers, Microsoft Graphics Component, Internet Explorer, Windows kernel, Windows Wireless Networking, Microsoft JET Database Engine, and the Windows SMB Server. It is important to note that the changes were not to these technologies themselves.
Types of errors witnessed:
Unexpected error from external database driver (1). (Microsoft JET Database Engine) [Microsoft][Driver ODBC Excel] Reserved error (-5016). [Microsoft][ODBC Excel Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process
WORKAROUNDS & SOLUTION:
Use Microsoft.ACE.OLEDB.12.0 or Microsoft.ACE.OLEDB.16.0: (Recommended)
The following updates where not intended to cause any issue with Microsoft Jet Database Engine 4.0, at the same time the product group developers were not verifying these updates would be compatible with Microsoft Jet Database Engine 4.0 data provider as it had been deprecated back in 2002:
As both articles suggest for the below workaround.
In all current known cases, using the ACE provider works to connect to the excel files in lieu of the JET provider. The following download is the most up to date version for the ACE provider:
Microsoft Access Database Engine 2016 Redistributable https://www.microsoft.com/en-us/download/details.aspx?id=54920
When looking into this issue, the largest thing to note is: The JET provider has been deprecated as of 2002. The last changes were made to this in 2000. See the following article for more details.
Data Access Technologies Road Map https://msdn.microsoft.com/en-us/library/ms810810.aspx
“Microsoft Jet Database Engine 4.0: Starting with version 2.6, MDAC no longer contains Jet components. <br>In other words, MDAC 2.6, 2.7, 2.8, and all future MDAC/WDAC releases do not contain Microsoft Jet, the Microsoft Jet OLE DB Provider, the ODBC Desktop Database Drivers, or Jet Data Access Objects (DAO). <br>The Microsoft Jet Database Engine 4.0 components entered a state of functional deprecation and sustained engineering and have not received feature level enhancements since becoming a part of Microsoft Windows in Windows 2000.”
So, in short the JET provider has been working for a good 15 years after deprecation, but this most recent update caused a change which requires an update to how you are connecting to the Excel file. For the SSIS packages, we recommend pointing to the Excel by our Excel connector instead of using OLEDB.
When using JET, this is done through an OLEDB/ODBC source. You can use the same method for the ACE provider. The ACE provider will work, however it is not supported for use with programs such as SSIS, Management Studio, or other applications. Although this doesn’t tend to cause issues, it is important to note. That notwithstanding, the ACE drives provides the same functionality as the JET provider did. The only limitation I am aware of is the same you were encountering with JET which is that you can't have multiple users connecting to and modifying the Excel file.
Microsoft Access Database Engine 2016 Redistributable
The Access Database Engine 2016 Redistributable is not intended: 4. To be used by a system service or server-side program where the code will run under a system account, or will deal with multiple users identities concurrently, or is highly reentrant and expects stateless behavior. <br>Examples would include a program that is run from task scheduler when no user is logged in, or a program called from server-side web application such as ASP.NET, or a distributed component running under COM+ services.
I understand that there are many users that don’t know how many packages might be experiencing this issue. It is possible to look through your dtsx packages using the following method.
If you run a command prompt as an administrator, you can use the find command to look through the packages for the keyword JET. This will state all the files it looks through, but you will see a connection manager result for the files that have this in them. If you have already updated the package from JET to ACE, then this will not show the connection manager and is not affected by this security update.
In a command prompt:
Find /I “Jet” “C:\SampleFolder\SamplePackage.dtsx”
Alternatively, you can search the whole folder at once:
Find /C /I “Jet” “C:\SampleFolder\%.dtsx”
For more information on the Find command:
Additionally after the installing and upgrading to ACE providers, you may run into the following error message,
The 'Microsoft.ACE.OLEDB.16.0' provider is not registered on the local machine Or The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
If you are in a scenario where you have both 32-bit and 64-bit processing being performed on the same server that needs to use the ACE data provider, from the Microsoft standpoint, it is recommended to have 2 different servers (1 to process 32-bit mode and the other for 64-bit mode).
But there is an option (workaround) where you can have both the versions installed on the same machine by performing a “/quiet” install of these components from command line. To do so, download the desired AccessDatabaseEngine.exe or AccessDatabaeEngine_x64.exe to your PC, open an administrative command prompt, and provide the installation path and switch /quiet. Ex: C:\Files\AccessDatabaseEngine.exe /quiet. Please note that this approach is not recommended and haven't worked in few instances, so would request you to move to 2 different server approach if possible.
Uninstall the security patch (Not recommended):
This patch seems to update Excel Jet connector from V4.00.9801.0 to v4.00.9801.1.
One of the workarounds is to uninstall the KB and it may fix the issue. Although, in some instances it may not help to resolve the issue.
Registry change (Not recommended): [Request you to take a backup of the registry key before making any changes]
Another workaround would be to update the below registry key to point to an old copy of the DLL file:
To get an old copy of the DLL, uninstall the patch KB4041681, copy the DLL "msexcl40.dll" from C:\Windows\SysWOW64\msexcl40.dll to a new location say "C:\\msexcl\\msexcl40.dll".
You can now modify the registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel\Win32] to point to the new DLL location "C:\\msexcl\\msexcl40.dll" (by default it’d be pointing to C:\Windows\SysWOW64\msexcl40.dll)
Other workarounds discussed online:
There is a public forum discussion where many customers found various ways to work around this issue.
ODBC Excel Driver Stopped Working with "Unexpected error from external database driver (1). (Microsoft JET Database Engine)" https://social.msdn.microsoft.com/Forums/en-US/2feac7ff-3fbd-4d46-afdc-65341762f753/odbc-excel-driver-stopped-working-with-unexpected-error-from-external-database-driver-1?forum=sqldataaccess
The best recommended solution is to move to Microsoft ACE OLE DB provider.
Apart from this, Microsoft is working on a resolution and will provide an update in an upcoming release of the security patch. This is expected to be available in another 2-3 weeks or earlier. (Blog is updated with this information). If this is business critical and you are still encountering any related issues, please reach out to the Microsoft Customer Services & Support(CSS) team.
THE ABOVE INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Chrone Meade - Support Engineer, SQL Server BI Developer team, Microsoft
Jon Herman - Sr Support Engineer, SQL Server BI Developer team, Microsoft
Krishnakumar Rukmangathan – Support Escalation Engineer, SQL Server BI Developer team, Microsoft