Friday, March 31, 2017

Quick Fix : OLE control or Automation server identified by GUID-{F9043C85-F6F2-101A-A3C9-08002B2F49FB} not found

If you are working with a version of Microsoft Dynamics NAV, then most probably you might be familiar with below error message. 


This message is for C/AL Programmers:
Could not create an instance of the OLE control or Automation server identified by GUID-{F9043C85-F6F2-101A-A3C9-08002B2F49FB}.
Check that the OLE control or Automation server is correctly installed and registered.
GUID always helps to find the root cause for the issue. (Google GUID and you will get list of solutions)

In this case GUID {F9043C85-F6F2-101A-A3C9-08002B2F49FB} refers to the "Microsoft Common Dialog Control, v6.0". 

This normally get installed and placed in below folder path : "C:\WINDOWS\System32\comdlg32.ocx' and C:\Windows\SysWOW64\comdlg32.ocx"

Fix:
  • Download "comdlg32.ocx" from here.
  • Copy downloaded file to below two folder path
    • C:\Windows\System32
    • C:\Windows\SysWOW64 
  • Run command prompt in administrator mode (Run as administrator)
  • Run below two commands in command prompt to register comdlg32.ocx
  • 1:  regsvr32 c:\Windows\system32\comdlg32.ocx  
    2:  regsvr32 c:\Windows\SysWOW64\comdlg32.ocx  
    
  • After each command you will get individual confirmation messages. 
Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Quick Fix : There is no system code page on your computer that matches the code page of the collation for the database.

If you are still using a old version of Dynamics NAV or if you are trying to upgrade old version to a newer version of Dynamics NAV, then you might have a chance of getting below error message when you open up the database from Classic Client. 
---------------------------Microsoft Dynamics NAV Classic---------------------------
There is no system code page on your computer that matches the 850 code page of the SQL_Latin1_General_CP850_CI_AS collation for the XXXXXXXXXXXXXXXX database.
Your system code pages are: ANSI: 1252, OEM: 437.
Ensure that the Regional Options of the computer use the correct system language and locale for the code pages to match.
You can also disable the 'Validate Collation' setting for this database. It is possible that certain text data will not be converted correctly when stored in the database.
Click OK to disable the 'Validate Collation' setting and continue to use the database, or click Cancel to exit.
---------------------------OK Cancel ---------------------------
This error us due to your DB collations is different from your computer collation. You can have a quick fix to resolve this error however you might need to talk to your system and DB admin for a permanent solution. 

Quick Fix:

You need to change registry value in your computer to required Code page. In order to do that,

1. Press Start + R : To open Run Window
2. Enter "regedit" and click OK to open "Registry Editor"
3. Navigate to below path and find the OEMCP
4. Double click on the OEMCP and change Value Data to 850.


 [HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \Nls \Codepage] OEMCP = "850" (Default = 437)  

5. Restart Your computer to update registries. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Sunday, March 12, 2017

Quick Fix : Visual Studio displaying NAV Report Layout as XML

I got this issue with Visual Studio 2015 Enterprise Edition. 

Every time I open a Dynamics NAV report layout in Visual Studio, RDLC is rendered as XML file instead of visual layout with all the fields and tool boxes. 

How the report layout looks: 

FIX : In order to fix the issue you need to install "Microsoft SQL Server Data Tools"

To install "Microsoft SQL Server Data Tools" you need to go to 
Control Panel  -> Programs and Features - > Microsoft Visual Studio <Edition> -> Change

Or you can re run the installation setup. 
From the features list, enable "Microsoft SQL Server Data Tools" option and proceed. 
Once the installation is completed you are good to go. This time report layout will open in correct design layout. 
Hope this helps you to resolve the issue. happy designing. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Saturday, March 11, 2017

Best Practice - SQL Script

Hi,

This blog post is about one small best practice that can save lot of time in the long run if you are working with SQL Server Management Studio. 

Many people who involved in Dynamics NAV does not have a very close relationship with SQL Server Management Studio even though back-end of NAV is totally based on SQL DB. 

Even during that very little usage of SQL Server Management Studio, many people (including me) use wizards to do things because it's more easy and error free most of the time. 

Just like below, few clicks and we are almost there.. 


If we making backup (as an example) of same database for 10 times, then that mean we need to go through the same process over and over 10 times. 

Is there way we can do all those in one simple click? 

This blog post is about that. How about we create a small script in other word SQL Query which will do the same process for us. 

If you are not an expert in  SQL then you can use wizard to build your query. Do all the steps you usually do and then stop just before you press OK. 

Click on Script button and save it on a file or open in a new query window. 

If you open up in a new query window, your query will look like this and you can change the parameters as you want and just press execute. it will do the job for you.
 
Beauty of this method is that you do not have to go through wizard to get your task done, you can just do that with a click of a button. Think about time you going to save in long run. 

Other advantage is if you are doing a time consuming process then SQL Management Studio will show you the progress of your process in text format. 

I should give credit and thankful to SQL expert, my colleague Tomasz Szypilo who pushed me to use SQL scripts. 

Thank you for reading and hope you learned something from the blog post. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara