Unanswered: Get Mode of Current DB (exclusive or not)
I'm setting up a DB where I do not want to set up security and I was wondering if there was any way to find out through VBA, or whatnot, if the database has been opened in exclusive mode or shared mode. I want to restrict updating unless its open in exclusive mode. I've thought of a strange way to do it (going out to the directory and seeing if the .ldb file exists, and using that as my determinant). Is there a better way to figure it out?
Thanks for the info man. I think the AllProperties will tell me if the user has exclusive mode. When I try to write it in VBA though (or try the MSDN example below), I get a compile error that it doesn't recognize the database or container type. Is it like java where I have to import anything? I'm still a bit new to VBA.
Here's the code:
Example (Microsoft Access)
The following example checks the AllPermissions property for the Forms Container object and determines whether the user specified by the UserName property has full access to forms.
Note The And operator performs a bitwise comparison to determine what permissions are currently set.
Dim dbs As Database, ctr As Container
' Return reference to current database.
Set dbs = CurrentDb
' Return reference to Forms container.
Set ctr = dbs.Containers!Forms
' Check if AllPermissions property includes full access.
If (ctr.AllPermissions And dbSecFullAccess = dbSecFullAccess) Then
MsgBox "User " & ctr.UserName & " has full access to all forms."
Set dbs = Nothing
Here's the link: http://msdn.microsoft.com/library/de.../D2/S5A263.asp