Microsoft Office Access - User does not have permission to perform this action

Hi all.

I have an Access 2003 ade file that has a form that creates logins for my Access form. I get the following error:

"User does not have permission to perform this action"

When it gets to this line of code in the VBA:

DoCmd.RunSQL "EXEC sp_grantlogin '" & WindowsID & "'"

Open in new window

WindowsID is a field on the form. I don't know why this is happening. The user has datareader and datawriter permissions in the database.

What is going on?

Thank you in advance.
Who is Participating?
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The user login under which you're running that "sp_GrantLogin" command must be a member of the SQL Server  sysadmin or securityadmin group. You'd have to up the permissions of the user, or use a different login to connect to the server.
Sim1980Author Commented:
I've never had to do that. But I'll go ahead and do that and see.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.