By default which database to connect is stored in a config file called ClientUserSettings.Config file.
In this case to fix the error ,the user need to update the ClientUserSettings.Config file and change the server and server instance key values to point to the TEST database.
The path for the ClientUserSettings.Config file is
C:\Users\\AppData\Local\Microsoft\Microsoft Dynamics NAV
You need to change the below three key values and make sure they point to the TEST Server Instance.
Once you change and restart the NAV client it will open it successfully, given that user is setup properly.
In the case of the new user has not been granted permission to access the specific database you may receive the below error.
Most of us must have seen this error when we try to login into NAV, the reason for this error is the user who is logging into NAV does not have access to the database or the user is not setup in NAV RTC.
To fix the above error, you need to setup the user in NAV. All the steps to create a new user is in the below Url.
In another scenario when you have multiple databases and when the user is trying to login into a database, where the user is already setup as user in one of the database but he gets the above error and NAV client closes when he clicks OK.
Let’s assume we have two databases in this scenario TEST and PRODUCTION.
The user who is trying to login, has access to the TEST database but he does not have access to the PRODUCTION database, so in this case the error is valid since the NAV is trying to login into PRODUCTION database by default. But the real issue is NAV does not provide a way to login into TEST database, as it shuts down when you click OK.