i’m a beginner in MS Access 2010, Please help me to Do the following in web DB in MS access 2010 :
- save user login name ‘Full Name’ from the table ‘Users’ into global variable ‘username’.
- when the user select his name from the login form ‘login’, then insert it into another form in a txt filed ‘Text57’ to save it to the record.
Is there any reason that you attempting to build your own logon form here? You are not able to get access or use a published web site without having FIRST a legitimate user logon in the first place.
It thus makes no absolute sense in any way to attempt to build your own logon and Security System. The user can never launch your logon form unless they ALREADY have a legitimate user ID and user logon issued to them. They’re going to have to enter their logon and their password before they can launch your form in which you again are suggesting the type in their user ID and logon!
Worse, attempting to build your own logon system is going to cost you more in development time than likely your whole application. Worse the resulting system you build is going to have virtually no security at all anyway.
Furthermore since the Security System is built in as part of Access web services (SharePoint or office 365), then the user and cannot logon and use any of the application unless you ALREADY issued them permissions and given them a valid logon. So they can never get to this logon form without already being legitimately logged on an authenticated into that system anyway.
However you can get and obtain use of the current logged on web user with the following function:
CurrentWebUser(N)
The values for N are:
In addition to the above function to get the current logged on user, you can also test for user membership within security groups that you create. That command is called:
So it’s not clear why you’re attempting to build your own logon form since none of your users will be able to get to the logon form unless they’ve been issued a user logon and legitimate password before they can launch such a form in the first place.
Furthermore, while attempting to build your own logon system in client based applications with VBA was often possible, most of the time the whole thing becomes not secure, and furthermore the whole thing is in general a big huge kludge.
However in the case of access web services because the programming language and environment is MORE limited than that of VBA, then attempting to build your own logon system in access web services is even more of a worse idea then doing as such with VBA applications.
At the end of the day there’s a good number of commands that allow you to test who the current user as, and furthermore keep in mind that all published web tables have logged automatically for you and a set of additional columns are added in which you can track not only who created the current record in a table, but also who last edited that row of data. So logging and tracking in Access web services is quite to Ref it, because it’s down to the role level, and is done automatically for you. The columns you get for every single table after published link are the following:
Note carefully and the above this means that the system not only automatically tracks who edited a row last, but it also shows you who actually created the row, and this means you can filter and build queries based on the above expressions to restrict data to the given individual. The above additional rows are automatically added to all Access tables when you publish to the web.
It therefore makes little if any sense to attempt to extract or utilize the current logged on user into some global variable. However at logon time, you can most certainly set the expression CurrentWebUser into a global verbal if you wish.