Please note that this is not an exhaustive discussion and but simply represents the things that come to my mind when seeing this error.
Why does it appear?
The can be several reasons why this message appears and it usually comes when there has been a change in the configuration of the system. This maybe as a result of an upgrade, or if the SQL password for the "sa" user has been changed, and the same change has not been affected in CRM.
There are some helpful questions to ask when this happens.
Does the error appear for all users?
If the system administrator can logon but another user can not, you will have to turn on the system logs and see what happens. Start looking at the SQL logs and see if the requests are getting to the database. It may give you enough information to sort out the problem.
Is your database running?
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
LoginName: sa You may need to recreate views manually.
This is symptomatic of a database server that is not running. Can you connect using query analyser or other SQL tool?
If the database is already running.. stop and start the database service and retry.
Have you just restored a backedup database?
The error message can appear when you have a mismatch between database and CRM versions. For example you may get the message if you have restored an earlier Sage CRM version database to an install of a later version of Sage CRM.
Is CRM trying to connect to the correct database?
Go to start\run\regedit\HKEY_LOCAL_MACHINE\SOFTWARE\eware\config click on the CRM beneath that and see the right panel see that default databaseserver name is exactly you have, if it is not, then change it manually. You'll need to do an IISRESET before you try and logon again.
Have you changed the database password?
Login failed for user 'sa'
LoginName: sa You may need to recreate views manually.
This can be symptomatic of when the "sa" password was entered correctly but contains a special character, such as $, in the beginning.
Or more alarmingly it can be symptomatic of someone or something (e.g. a Virus, worm etc) changing the password on the database server.
If you need to change the "sa" password, the correct thing to do is to logon to CRM, change the database password under Administration>System>Database first, then reset the password in MSSQL, and finally reset IIS and logon to CRM again.
But if the database "sa" password has been reset first, then it will not be known to CRM, so you will not be able to connect to the database. Then you'll need to reset the password in MS SQL to the previous password.
But what if you don't know the database "sa" password? You will first need to reset the "sa" password to something you do know. Then you will have to reset the password in the CRM registry. (Backup the registry before doing this!!!).
In the registry browse to HKEY_LOCAL_MACHINE | SOFTWARE | eWare | Config | [CRM], where [CRM] is the name of the CRM instance.
You can set the DatabasePassword to the new database password in plain text. Do an IISRESET, then you should be able to logon to CRM. Once you have logged on to CRM go and reenter the new password and it will be saved back into the registry in encrypted form.
But how do I recreate views manually?
There is a view in the Sage CRM database called "vsentinel". When CRM first starts up (after an IISRESET) and it finds that vsentinel is not present, it will use this as the trigger to force the recreation of the views based on the definitions stored in meta data. Once the other views have been recreated it then creates the trigger view "vsentinel" again.
To force the recreation of the views do this:
1. Do IISRESET from the Run prompt.
2. Go to the SQL Manager. Take a backup of your CRM SQL Database first.
3. Now through SQL Manager itself, select the CRM SQL Database instance. There you will find an option Views which lists all the Views against it.
4. Select the user view "vsentinel". All CRM views are prefixed with ‘v’.
5. Press the Delete key from the keyboard and drop the view.
6. After the IISRESET, try to login to CRM and see whether you are able to log in to CRM now or not.
Have you been editing the Themes CSS files in Sage CRM?
This can seem surprising as it has nothing to do with the database and everything to do with a corrupt CSS file being in the Themes folder.
As part of developing a theme a cascading stylesheet will have to be created and edited that contains the style settings for the new look and feel that is being constructed. But there is a section of the stylesheet that has to be preserved. This is clearly marked in the existing stylesheets.
CRM GREEN CUSTOM SETTINGS
DO NOT CHANGE FORMAT BETWEEN 'CRM SETTINGS' TAGS
//theme file version
VERSION = 1.0
The values within this section maybe changed BUT the structure must be preserved. If this section is corrupted or is absent in any css file contained in the Themes folder
then it will generate the 'You may need to recreate views manually' message when someone tries to first logon after IIS has been reset. It does not matter is the CSS file is not referenced in translations. All CSS files in the folder are scanned. The origin of the error may be shown in the system log in this case.
So What happens if I still can't log on?
Remember this was not an exhaustive article. Don't panic. Think about what has just changed in the system? Have you applied a new component? Can you restore to the prior state? Have a good look through the forums and knowledge base and then log a case with support. It is almost certain that your problem has been seen before and that support will know what to do.
I hope that this article has helped.
If you have further hints and tips based on your experience then please feel free to post them as comments to this blog article.