MS CRM 4.0 Cannot Access CRM - Database Connection Fails

PROBLEM:
  • You have just installed MS CRM 4.0 Outlook 07 Offline Client and are receiving either of the following errors: "Action Microsoft.Crm.Config.Common.InstallDatabaseAction failed. CREATE DATABASE permission denied in database 'master'" or "Action Microsoft.Crm.Config.Common.InstallDatabaseAction failed. The network path was not found." 
  • The errors can appear when running the configuration wizard, when trying to access CRM or when trying to go offline. 
  • Error does not appear when using the web client. 
  • Server is running SQL Version 2000 or 2005 (could also happen with 2008) 
  • None of the rollups fix the problem 


SOLUTION THAT WORKED FOR ME:
The error means CRM could not connect to the local database.

CRM 4.0 binds to a specific user when installed and set-up. The same user (the person who will use CRM on the client) needs to install AND run the configuration wizard. Since installing CRM requires administrator privileges, you need to give the user Administrator privileges on the local machine at least until the configuration wizard has completed and you have confirmed CRM is fully up and running. Not doing this means the CRM will fail to connect to the database (if it gets set up at all).
  • If you have installed CRM under a different username to the one that will be accessing CRM, uninstall it completely, including the SQL databases (be careful when you uninstall the database as you could break other programs that rely on SQL). A reasonably good discussion about how to remove is here: http://bit.ly/aGCA33
  • Ensure the user (who will be accessing CRM) has administrator privileges on the machine where CRM will be installed. 
  • After setting the user as an administrator, re-start the computer and start the installation again. 
  • Once you have installed CRM, run the configuration wizard under the same username as you used for the installation. Double check the server URL used in the configuration wizard. If that is misspelt, it will cause problems. 
  • After checking the operation of CRM, including the offline and online process, you can decrease the user's privileges again and check the operation of CRM. 


OTHER POSSIBLE SOLUTIONS:
If the above solution doesn't work or only sort of works, it could be that the installation failed to set up the user as an administrator in SQL 2005 server on the client computer. So:
  • Open SQL Server 2005 Surface Area Configuration on client computer (run under the client's username with administrator privileges) 
  • Click Add New Administrator 
  • Most likely, only one role will be available in the left hand pane, the SysAdmin role for the CRM database. Add role to the right hand pane and click OK. 
  • Restart the computer 
You should then be able to re-try the action that failed last time (whether it was the configuration wizard, offline process or accessing CRM).

NOTE: Sometimes the above process does not work, so you have to try again. Alternately, you can try creating the sysadmin user in SQL using command prompt:
  • Ensure you are logged into the local machine as an administrator 
  • Click Start, type cmd or find Command Prompt in the start menu. 
  • Right click on cmd.exe / Command Prompt and select "Run as Administrator" 
  • Type cd c:\ (substitute appropriate drive letter). This should take command prompt back to the root directory of the drive 
  • Type sqlcmd -S .\crm and hit ENTER 
  • Type CREATE LOGIN [domain\user] FROM Windows and hit ENTER then type Go and hit ENTER again 
  • Type EXEC sp_addsrvrolemember @loginame = 'domain\user', @rolename = 'sysadmin' and hit ENTER then type Go and hit ENTER again 
  • Restart the computer 
Some other suggestions:
  • Business Contact Manager and CRM are NOT compatible, so this error can occur when you fail to uninstall BCM before installing CRM. 
  • If the specific error message is "Action Microsoft.Crm.Config.Common.InstallDatabaseAction failed. Unknown user name or bad password", follow instructions here: http://support.microsoft.com/kb/857505
  • Error could also occur if the CRM databases (and their containing folder) are compressed or if the user or Network Service does not have administrator control of them. Check properties of the folders and databases, which should be under one of the following in Vista and Windows 7, depending on the specific rollup installed: 
    • C:\Users\<username>\AppData\Roaming\Microsoft\MSCRM\Data (remember the AppData folder will be hidden, so you need to un-hide it), or 
    • C:\Users\<username>\AppData\Local\Microsoft\MSCRM\Data 
  • Run the diagnostic wizard and turn on tracing if not already enabled. If the wizard does not solve the problem, hopefully you can use the trace to track down where the failure is occurring. A good description of the diagnostic wizard and it's functions can be found here: http://blogs.msdn.com/b/crm/archive/2008/01/22/introducing-mscrm-client-diagnostics.aspx
  • If none of these work, call Microsoft Support, as it could be some hitherto unknown thing that will commit you to an insane asylum if you try to figure it out alone.