The Current User

The current user is defined as the user who is currently logged on to the database application. For most security-related operations, you need to know the name of the current user. DAO provides a convenient way of obtaining this information using the Workspace object's UserName property.

strMyName = DBEngine(0).UserName

Using this property, you can create a User object for the current user, without having to know their name, like so:

Dim usr As DAO.User

Set usr = DBEngine(0).Users(DBEngine(0).UserName)

0 0

Post a comment