Error: Login Failed—Cannot Open Database in Reports
Symptom
When you attempt to open a Netwrix Auditor report, you see the following error:
An error has occurred during report processing.
(rsProcessingAborted)
Cannot create a connection to data source ‘DS’.
(rsErrorOpeningConnection)
"Cannot open database <%Database_name%> requested by the login.
The login failed. Login failed for user <%User_name%>"
Cause
The Audit Database Account used to connect to SQL Server does not have the required permissions to access the target SQL database %database_name%.
Resolution
Verify that the db_owner role for the target database is assigned to the default Audit Database Account by following the steps below:
- Navigate to Start > All Programs > Microsoft SQL Server > SQL Server Management Studio.
- In the Object Explorer pane of SQL Server Management Studio, navigate to Security > Logins >
%Audit_Database_account%. Right-click the account and select Properties. - In the User Mapping tab, locate the affected database and verify that the db_owner role is assigned. Click OK to save the changes.
For additional information on required access rights, refer to the following article: https://docs.netwrix.com/docs/auditor/10_8 Audit Database Account — Requirements for SQL Server to Store Audit Data · v10.7).
IMPORTANT: If your account lacks the correct permissions to assign the roles, you can run your SSMS instance in the single-user mode. Learn more in https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/start-sql-server-in-single-user-mode?view=sql-server-ver16 (Single-user Mode for SQL Server · Microsoft 🡥).
Related Articles
- https://docs.netwrix.com/docs/auditor/10_8 Audit Database Account — Requirements for SQL Server to Store Audit Data · v10.7)
- https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/start-sql-server-in-single-user-mode?view=sql-server-ver16 (Single-user Mode for SQL Server · Microsoft 🡥)