Run VBA code as admin

5 pts.
Tags:
Microsoft Access
VBA
I am currently working on an ms access application for a large insurance company which generates reports for the user after the user inputs/select some data.... Unfortunately the application has already been built - and till now we used to run the application/reports by logging in as admin.. however, we now want that users login to the database as a 'user' with limited privileges- but the VBA code, which is locked to run with privileges as admin. Our plan is users sign onto this ms access application/database as a user with few privileges on the underlying tables/forms..all the tables and forms and VBA modules are owned by admin....we don't want the user to be able to view most of the tables but we want the entire VBA code to run with the privileges as admin.. how do we do that.. the user logs on to ms access db as a regular user, with privileges on very few tables/forms.. and the background VBA code which generates the code runs successfully with privileges of the admin user.. is that possible..we want to allow the user to keep this ms access database/application on any directory they wish on their local PC. Thanks again! chandran gangadharan Toronto, Canada

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use the VBA command: Shell() to execute SysInternals ShellRunAs or PsExec to execute command line instructions on local or foreign machines. However, that would require storing the elevated credentials somewhere Access can read them,.. there may be Security-safe ways to do that, but I’m not familiar with them.

Alternatively, if you’re running MS-SQL Server somewhere in your domain, you can set up Stored Procedures to execute the instructions as a specific user while granting privileges to execute the SP to other users. If you’re running the SQL Server in an Active Directory domain on a machine other than the Domain Controller, you’ll need to set the DC to trust the SQL Server computer for Delegation (Active Directory Users and Computers).

Other SQL Server software may also have similar functions/features.

Jordan Lewis
Business Automation

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following