MS Access 365 with data on SharePoint-online - VBA to get login info when not connected to company network (1 Viewer)

BrainstormUK

New member
Local time
Today, 15:14
Joined
May 7, 2009
Messages
10
I have an MS Access system that grabs the username off the company network to allow user privilege access - CreateObject("WScript.Network").UserName . All data is stored in SharePoint Lists so that users can access the system when not in the office. My problem is, how can I check a user's privileges (ie whether they can edit, add new, delete data etc ) when they are out and about not on the company network? Any ideas most welcome as not quite sure where to go.

I suspect one way to go is to use OneDrive but not quite sure how to get the user's name esp. as they would be using a laptop and it could be a personal one - OK, so they can switch user accounts in MS Access to the company login but that won't give the windows login from the machine as with the company login.
 
While I can't address the ability to check users' privileges in SharePoint from VBA (although I'm sure it can be done one way or another), I do have to respond to this:

"I suspect one way to go is to use OneDrive...."

Perhaps your exact intentions regarding OneDrive might make a difference, but OneDrive is not an option for a multi-user Access accdb location. It's possible to use OneDrive as a backup location, or a deployment location for accdbs, for example. That assumes people only copy a fresh copy of the master accdb from OneDrive and never try to run it from OneDrive.

Search here for one of the many posts in which The_Doc_Man has reiterated the problems that arise out of trying to use Access in that sort of enviroment.
 
Hi George - fully agree wouldn't dream of having the data in OneDrive, I was just thinking that the user details might be in some way in One Drive or perhaps I could put some sort of file to validate against so that then the app can decide if the can edit/add new/etc the data shown in the forms.
If they are using a personal pc at home or a personal laptop out and about, their personal One Drive won't be the same as the Company One Drive but they will have to 'Switch' their Access account otherwise they won't be able to get into SharePoint and here it all gets a bit wooly for me...
 
[...] so that then the app can decide if the can edit/add new/etc the data shown in the forms
Does Access allow the user to edit data they don't have permission to? This should raise an error when they try to sync the data to Sharepoint at the latest, shouldn't it?
 
Hi Sonic, I think you misunderstand. Access is linked fine to with Owner permissions to SharePoint.
Access then allows users to Add Edit Delete etc by making forms read only or whatever depending on the login of the user
 
Hi George - fully agree wouldn't dream of having the data in OneDrive, I was just thinking that the user details might be in some way in One Drive or perhaps I could put some sort of file to validate against so that then the app can decide if the can edit/add new/etc the data shown in the forms.
If they are using a personal pc at home or a personal laptop out and about, their personal One Drive won't be the same as the Company One Drive but they will have to 'Switch' their Access account otherwise they won't be able to get into SharePoint and here it all gets a bit wooly for me...
Gotcha. Thanks
 
Hi Sonic, I think you misunderstand. Access is linked fine to with Owner permissions to SharePoint.
Access then allows users to Add Edit Delete etc by making forms read only or whatever depending on the login of the user
I assumed, as permissions appear to be important, they would have been set where it matters.

You could create and link a dummy list on Sharepoint. On startup your application writes an identifiable record to that table (list) and you then read the "Created By" column of that new record to get the Sharepoint user. - Of course, for this to work, the user must be online with Sharepoint, but if this is not the case there simply is no way to reliably identify the current user.

Maybe there is a better/easier solution to make your approach work, which I'm not aware of.
 
Nice idea Sonic8 will try that out
Thanks for all the help.. I was just looking into the 'Hidden' UserInfo list which is automatically added into my linked table
 
I have an MS Access system that grabs the username off the company network to allow user privilege access - CreateObject("WScript.Network").UserName . All data is stored in SharePoint Lists so that users can access the system when not in the office. My problem is, how can I check a user's privileges (ie whether they can edit, add new, delete data etc ) when they are out and about not on the company network? Any ideas most welcome as not quite sure where to go.

I suspect one way to go is to use OneDrive but not quite sure how to get the user's name esp. as they would be using a laptop and it could be a personal one - OK, so they can switch user accounts in MS Access to the company login but that won't give the windows login from the machine as with the company login.
Get their Special Folders path, like desktop, and strip away everything but the username portion
 

Users who are viewing this thread

Back
Top Bottom