“SQL Server does not exist or access denied” using Windows 10, build 1803

Microsoft SQL Server logo

If you are running your Microsoft Dynamics C5 or Microsoft Concorde XAL program files off a SMB1.x share, and your client is running Microsoft Windows 10, your C5/XAL might stop working if you upgrade your Windows 10 to build 1803.

This is really a “far out” bug, in build 1803 Microsoft apparently strengthened some security which makes it impossible to connect to a SQL Server through ODBC if – and only if – your program files are stored on a file sharing running SMB1.x (which means it will actually work if you copy your program files to a local drive – but that will off cause break things – some C5 and XAL files needs to be shared!).

And now we’re at it – this is not only hitting C5 and XAL, but other systems using ODBC as well: https://www.google.com/search?source=hp&ei=zfH6WqasBorGwQKImqroDw&q=sql+connection+problem+after+windows+update+1803&oq=sql+connection+problem+after+windows+update+1803

The solution is straight forward: make your file share run SMB2.0 or newer:

Hint: If you run this PowerShell command on your client, it will list all your network shares and the SMB-version in use for each of them:


Even Microsoft gets this wrong :-)

Microsoft Dynamics NAV logo

In Dynamics NAV events are also fired on temporary records – this is really a confusing design and can trigger various, hard to debug, but rather serious issues.

On one customer running NAV 2018 CU1, user group memberships was cleared randomly. We did’nt know exactly when, but in the end one of my Indian colleagues figured out it happened related to the “Export to a datafile” functionality.
I was pretty sure someone was doing a DELETEALL – but was it in our code or in the standard code? And exactly how/where?

Actually it was easily found.
I created a subscriber one the delete trigger in table 9001 / User Group Member – only with one line of code:


…and started the debugger.

Note that events are fired even if the table trigger is not executed (i.e. INSERT/DELETE/MODIFY/RENAME is called with FALSE).

The deletion of the group membership is caused by the select/deselect all companies on the “Export to a Datafile” page in NAV. The list of companies is build in a temporary company record and DELETEALL is used on it when you select or deselect the all companies flag.

Unfortunately there is a subscriber in Codeunit 2 called OnAfterCompanyDeleteRemoveReferences which does not check if it is actually called with a company beeing removed, or just called with a temporary record instance from somewhere.
So it cleans up anyway – removing actual reference data from still existing companies!

This shows very clear that non-self-explanatory functionality like events beeing called on temporary records should have been avoided by Microsoft when designing this.
After all the goal of the development environment and -language should be to help developers write correct code – not to trap them into creating bugs.

If I had to redesign this functionality I would make it an function trigger property (default off) if the subscriber should run on temporary record instances.
Or at least let a subscriber parameter tell if it is temporary or not (not that this would make it easier to check, but it would remind you about checking it every time you created a subscriber 🙂 ).

To me the current functionality is wrong, people are getting bitten by this. It is illogical design and even if you tried it once or even multiple times (and my guess is that you have if you are writing event subscribers), you’ll probably forget it and do it again in the future.

At least we know we are not alone – Microsoft C\AL developers are actually also getting bitten by this :-).

Please note – this bug is not only emptying the 9001 / User Group Member table, but other tables as well: User Group Access Control, Application Area Setup, Custom Report Layout and Repor tLayout Selection.

By the way: The correct fix (introduced in NAV 2018 CU2) is to make these lines the first two lines in Codeunit 2, OnAfterCompanyDeleteRemoveReferences: