Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding Security

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to be able to switch to a different Access user using VBA/Access Basic code. Once the user is running my app I need to be able to change to a different user using a coded function or subroutine. I'll have the UserID and Password necessary to supply as parameters. Any source of info to accomplish this in Access versions 2.0 through 2002 would be appreciated.

Thanks
 
I am assuming you are trying to accomplish something like the following...

User logs in with Basic Security level
Need to add new User but User doesn't have appropriate permissions
User is "granted" temporary permission to add new User
User's permission is not changed in any other way

Does this sound correct? If so, let me know and I will post you some code to do this... The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Yes, something like that. Under certain conditions based on a particular user I need to allow the viewing of a specific report in 'design view' that is secured at all other times and from other users. I would rather just temporarily switch to a different user, allow the process, and then switch back. This is not the complete picture but should give you an idea of the types of things I'm trying to accomplish.

Thanks again.
 
OK...That is about what I expected.....the below code comes from Chapter 13 of Microsoft Access 97 Developer's Handbook, published by Microsoft Press. I have changed it some, so you will have to modify it to fit your needs...If you need some help with this, please let me know.

I have used this code to give only me (the developer) Admin rights to a database application, but allow specific users the ability to "add" other users....should get you started.

' ******* Start Code *******
Dim W As WorkSpace

Set W = CreateWorkspace("TempDeveloperLogin", "Developer", "dev", dbUseJet)
Workspaces.Append W

Do whatever you need to do here

Set W = Nothing
' ******* End Code ******

Hope this helps you out.... The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top