
User and CloseButton - RE:
Hi again,
I have made the code below to check who is opening the database.
If it is the Owner he/she have AllPermission
As you can see the AllPermission returns a number. And my question
is can I be sure it allways the same number, and is this
a good way to check the owner off the database?
And Hi Dev if you see this messages,
"Concerning CloseWindowButton"
Thank you for tanking time to answering, but how can I trap this
information.
The for is a menu thats means that I have some code in the CoseEvent, which
comes after the UnloadEvent.
That means if the I have to put some code in the UnloadEvent that will
"disable" all the other events on the form. Do you get the point.
'**************************************Code
Begin**************************************
DBEngine.SystemDB = "system.mdw"
Dim dbs As Database
Dim ctr As Container
Set dbs = CurrentDb
Set ctr = dbs.Containers!Databases
Debug.Print "Container: " & ctr.Name
'Just a check
Debug.Print "User: " & ctr.UserName
'Just a check
Debug.Print " Permissions: " & ctr.Permissions
'Just a check
Debug.Print " AllPermissions: " & ctr.AllPermissions 'Just
a check
If ctr.AllPermissions = 393216 Then
Call StartupFunctionTBS
Call CheckMenuFile
dbs.Close
Exit Function
Else
Call HideDBwindow
Call StartupFunctionUser
Call CheckMenuFile
dbs.Close
Exit Function
End If
'**************************************Code
Begin**************************************
Mik Achton-Boel