web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Audit Trails errors when adding new user...then user can't add new employees

(0) ShareShare
ReportReport
Posted on by 500

Audit Trails module is installed.  When adding a new user, receiving the following error messages.

  1. Audit Trails will grant rights to the new user.
  2. GPS Error GrantAccessToUser: 58
  3. SQL Error GrantAccessToUser: 15023 [Microft][SQL Server Native Client 10.0][SQL Server]User, group, or role 'john' already exists in the current database.
  4. ODBC Error GrantAccessToUser: 37000

User is able to login to GP successfully but when attempting to add a new employee, is unable to do so and receives the following error message:

"A save operation on table 'UPR_MSTR' failed accessing SQL data."

When clicking on the "More Info" button it shows the following:

"[Microsoft][SQL Server Native Client 10.0][SQL Server]The server principal 'john' is not able to access the database 'TWOA' under the current security context.

Any help would be much appreciated.

*This post is locked for comments

I have the same question (0)
  • Jeff Rowles Profile Picture
    500 on at
    RE: Audit Trails errors when adding new user...then user can't add new employees

    Thank you for your input Arunprasath...yes, I had also checked this prior to my post but definitely worth mentioning.

  • Jeff Rowles Profile Picture
    500 on at
    RE: Audit Trails errors when adding new user...then user can't add new employees

    Thank you Somakarpagamoorthy,

    Your response led me through troubleshooting and to creating a modified version of some of the scripts viewed as shown below (note: I'm not sure why the line numbers are appearing in the code...they aren't in the copy I pasted...so you should edit/ignore them if using this script)

    --Script to run after establishing a new user who experiences Audit Trail module errors
    
    declare @UserId        varchar(30)
    
    set     @userid='john' --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  Enter user id here
    
    
    --recreate user and add DYNGRP role for desired databases...ensure to include the Audit --Trail companion databases (ie: TWOA)
    
    USE [DYNAMICS] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = @UserId) BEGIN CREATE USER [@UserId] FOR LOGIN [@UserId] EXEC sp_addrolemember 'DYNGRP', [@UserId] END USE [TWO] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = @UserId) BEGIN CREATE USER [@UserId] FOR LOGIN [@UserId] EXEC sp_addrolemember 'DYNGRP', [@UserId] END USE [TWOA] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = @UserId) BEGIN CREATE USER [@UserId] FOR LOGIN [@UserId] EXEC sp_addrolemember 'DYNGRP', [@UserId] END

  • Community Member Profile Picture
    on at
    RE: Audit Trails errors when adding new user...then user can't add new employees

    Jeff, Is the user a member of 'DYNGP' Role for the company database?

  • Verified answer
    soma Profile Picture
    24,410 on at
    RE: Audit Trails errors when adding new user...then user can't add new employees

    Also please have a look on the below link for various user access issues.

    dynamicsgpgeek.blogspot.ae/.../dynamics-gpsql-database-user-disconnect.html

    Hope this helps!!!

  • Suggested answer
    soma Profile Picture
    24,410 on at
    RE: Audit Trails errors when adding new user...then user can't add new employees

    Go to SQL server and check whether this user have access to GP company database (Security under Company Database) or remove the user from SQL server and create it again within GP then try again.

    Hope this helps!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans