Issue:

When trying to open Forecast 5, you are receiving the error below:


SqlException

Cannot open database "Forecast5V3_2018" requested by the login. The login failed.

Login failed for user 'Navsoft\JohnDoe'.

at Forecast5.DataAccessLayer.Forecast5Db_SQL2008.ExecuteNonQuery(String command)

at Forecast5.DataAccessLayer.Forecast5Db_SQL2008.RemoveThirdPartyViews()

at Forecast5.View.MainWindow..ctor()

at Forecast5.View.App.OnStartup(StartupEventArgs e)

at System.Windows.Application.<.ctor>b__1_0(Object unused)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


Cause:


This error message indicates that the user specified (highlighted above) does not have access to the database (italicised above).


Solution:


You will need to add the user to have permissions to access the database as per the steps below:



1. Open up Sql Server Management Studio, connect and login (using administrative permissions) to the SQL and Instance the database is stored on.

2. Once logged in, expand Security, right-click and select New Login:

2. Select Search from the main page, enter the name you wish to add and click Check Names. This will underline if the username exists. Click Ok.



3.Under Server Roles, tick sysadmin.



4. Under User Mapping, tick your database name and add db_owner.



5. Click Ok to save.

With these instructions, you can add any user that needs permission.


Note: Forecast 5 support can assist with this issue as long as we have been provided with the administrative login to the SQL Server.