IsExclusive(), IsReadOnly()
These two functions tell you what kind of access you have to a table or database.
Usage |
lExclusive = ISEXCLUSIVE( [ cAlias | nWorkArea | cDatabase [ , nType ] ] ) lReadOnly = ISREADONLY( [ cAlias | nWorkArea | 0 ] ) |
Parameter |
Value |
Meaning |
cAlias |
Character |
Tell whether the specified alias was opened for exclusive access or read-only. |
Omitted |
If nWorkArea and cDatabase are also omitted, tell whether the table open in the current work area was opened for exclusive access or read-only. |
|
nWorkArea |
0 |
For ISREADONLY() only, tell whether the current database was opened read-only. (This feature was added in VFP 7.) If no database is selected, an error message is displayed. |
Positive number |
Tell whether the table open in the specified work area was opened for exclusive access or read-only. |
|
Omitted |
If cAlias and cDatabase are also omitted, tell whether the table open in the current work area was opened for exclusive access or read-only. |
|
cDatabase |
Character |
Tell whether the specified database (DBC) was opened for exclusive access. |
Omitted |
If cAlias and nWorkArea are also omitted, tell whether the table open in the current work area was opened for exclusive access. |
|
nType |
1 or Omitted |
Return information about a table. |
2 |
Return information about a database. |
|
lExclusive |
.T. |
The table or database was opened for exclusive access. |
.F. |
The table or database was opened for shared access. |
|
lReadOnly |
.T. |
The table or database was opened for read-only access. |
.F. |
The table or database was opened for read-write access. |
Example |
SET EXCLUSIVE ON OPEN DATABASE TasTrade NOUPDATE USE Customer ? ISEXCLUSIVE() && Returns .T. USE Customer SHARED ? ISEXCLUSIVE() && Returns .F. SET EXCLUSIVE OFF USE Customer ? ISEXCLUSIVE() && Returns .F. USE Customer EXCLUSIVE ? ISEXCLUSIVE() && Returns .T. ? ISEXCLUSIVE("TasTrade",2) && Returns .T. USE Customer NOUPDATE ? ISREADONLY() && Returns .T. USE Customer ? ISREADONLY() && Returns .F. SELECT Last_Name,First_Name FROM Employee INTO CURSOR Names ? ISREADONLY() && Returns .T. ? ISREADONLY("Employee") && Returns .F. ? ISREADONLY(0) && Returns .T. |
See Also |