Bde.DBTables.TDatabase.Exclusive

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Exclusive: Boolean read FExclusive write SetExclusive default False;

C++

__property bool Exclusive = {read=FExclusive, write=SetExclusive, default=0};

Properties

Type Visibility Source Unit Parent
property published
Bde.DBTables.pas
Bde.DBTables.hpp
Bde.DBTables TDatabase

Description

Enables an application to gain sole access to a database.

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.

See Also