When Remote Programming Software opens, a secure connection is made to the database which is located in an instance of SQL. If the connection to SQL is not successful or the database is not accessible, the Database connection failed error will display (see figure 1).
Figure 1 Database connection failed error
Figure 2 Three common causes for the database connection failure
Figure 3 System Configuration Page
1. Failure to connect to the SQL Server. Details displays:
“A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. (Provider: SQL Network Interfaces, error: 26 – Error Locating Server\Instance Specified).”
In this case the connection to the SQL Server has failed causing the database connection to fail. Press OK and return to the Database Settings page. Troubleshoot using the following steps;
Figure 6 Verify the Service is running and Startup is Automatic
2. Failure to open the database. Details will display;
“Cannot open database “[database name]” requested by the login. The login failed. Login failed for user ‘sa’”.
In this case the database failed to open after the connection was made to SQL. Press OK and return to the Database Settings page. Troubleshoot using the following steps;
Figure 7 Install with Administrator Privileges
3. Failure to authenticate the user: Details will display;
“Login failed for user sa”.
The user “sa” is used when the database connection is made using SQL Server Authentication. There are two likely causes for the SQL Server user sa to fail. The sa password may either be incorrect or fails to meet domain requirements for complex passwords (if required). It may also be occur if the SQL installation was not configured for Mixed Mode.
Press OK to return to the Database Settings page. Troubleshoot using the following steps;
Download and install Microsoft SQL Server Management Studio (SSMS).
Figure 8 Download SSMS
Figure 9 Welcome to install screen
Figure 10 Select Restart
Figure 11 Open Management Studio
Figure 12 Log in using Windows Authentication
Figure 13 Object Explorer
Figure 14 Object Explorer Security expanded
Figure 15 Object Explorer Logins Expanded
Figure 16 Login Properties sa password
Figure 17 Connect to server with SQL Server Authentication
Figure 19 Select SQL Server and Windows Authentication Mode
Note that the overall settings in Microsoft SQL go beyond the scope of this article. The assistance of a qualified SQL administrator may be needed when the steps in this article have not resolved the "Database Connection Failed" error.