RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDatabase.Exclusive Property

Enables an application to gain sole access to a database.

Pascal
property Exclusive: Boolean;
C++
__property Boolean Exclusive;

Use Exclusive to prevent other applications from accessing a Paradox or dBASE database while this application is using it. Before opening the database, set Exclusive to true. The default value for Exclusive is false, allowing other applications to use the opened database. 

When Exclusive is true and the application successfully opens the database, no other application can access it. If the database for which the application has requested exclusive access is already in use by another application, an exception is raised. To handle such exceptions, write an exception handler. All tables in the database are effectively opened exclusively, as other applications would be prevented from opening the database and the tables would be inaccessible. 

A table database must be closed before changing the setting of the Exclusive property. Do not set Exclusive to true at design time if you also intend to set the Connected property to true at design time. In this case an exception is raised because the database is already in use by the IDE.

Note: An application can attempt to set Exclusive to true for SQL databases, but some SQL servers do not support exclusive database-locking. Others may grant an exclusive read/write lock, but still permit read-only access to other applications. For more information about exclusive locking of databases for a specific server, see the server's documentation.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!