Symptoms

The adTempus service fails to start and the following error message is reported by adTempus in the Application log in the Event Viewer:

The adTempus service cannot be started due to a database problem: adTempus is unable to connect to database 'adtempus_XXX' on server .\adtempus. Please verify that adTempus is configured with the correct database name. Cannot open database "adtempus_XXX" requested by the login. The login failed. (-2147467259; native error=4060; SQL state=42000) .

Cause

This error may indicate that the user account the adTempus service is running under does not have permission to connect to the adTempus database.

This situation can arise if the service is changed to use a different account, of if the adTempus database is restored from a backup created on another computer with different login permissions granted.

Resolution

Execute the following database script against the adTempus database to configure the login permissions. See article K00000385 for instructions on executing database scripts.

In the script, replace "adtempus_XXX" with the database name shown in the error message. If the adTempus service is running under a user account (rather than the Local System account), replace "NT AUTHORITY\System" with the domain and user ID of the account.

use [master]
GO
if not exists (select * from master.dbo.syslogins where loginname = N'NT AUTHORITY\System')
CREATE LOGIN [NT AUTHORITY\System] FROM WINDOWS with DEFAULT_DATABASE=[adtempus_XXX]
go
use [adtempus_XXX]
GO
if not exists (select * from dbo.sysusers where name = N'NT AUTHORITY\System' and uid < 16382)
CREATE USER [NT AUTHORITY\System] FOR LOGIN [NT AUTHORITY\System] WITH DEFAULT_SCHEMA=[dbo]
GO
exec sp_addrolemember N'db_backupoperator', N'NT AUTHORITY\System'
GO
exec sp_addrolemember N'db_datareader', N'NT AUTHORITY\System'
GO
exec sp_addrolemember N'db_datawriter', N'NT AUTHORITY\System'
GO
exec sp_addrolemember N'db_ddladmin', N'NT AUTHORITY\System'
GO
exec sp_addrolemember N'db_owner', N'NT AUTHORITY\System'
GO