Passive Shutdown is a little known, Jet 4 enabled feature that allows you to prevent Users from connecting to a Database. It is also known as Connection Control. This feature is referred to as '
Passive' since there is no way to forcibly boot Users out of a Database. This can be a very useful feature if you want to limit the number of simultaneous Users of a Database or you want to perform some administrative task, such as Backup.
You control Connections using the Jet OLEDB: Connection Control Property of the ADO Connection Object. To disallow any new Users of the Database, set the Property to 1. To revert back to allowing new Users, set the Property to 2. A simple code demonstration will dramatize the use of this Property.
- 'Initiate Passive Shutdown - do not allow new Users
-
CurrentProject.Connection.Properties("Jet OLEDB:Connection Control") = 1
-
'revert to original setting and allow new Users
-
CurrentProject.Connection.Properties("Jet OLEDB:Connection Control") = 2
NOTE: The Error Message that Users will encounter when trying to connect to a Database that has been Passively Shutdown is:
The database has been placed in a state by user 'user name' on machine 'machine name' that prevents it from being opened or locked.