Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i tell if a table is currently open and being used?

Status
Not open for further replies.

tristero

Programmer
Jan 24, 2003
95
US
by someone on the network?

i want to check if a table is being used before i try to
USE DBF() EXCLUSIVE

Dan Trenz
Ann Arbor, MI
 
nHandle = FOPEN('\Wt\data\doa.dbf',12)
IF nHandle = -1
MESSAGEBOX('Table is in use',16,'Warning')
else
messagebox("All good to go")

endif
=FCLOSE(nHandle) && need to close it


Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Checkout isexclusive command

cExclusive = SET('EXCLUSIVE')
SET EXCLUSIVE OFF
SET PATH TO (HOME(2) + 'data\')
OPEN DATA testdata && Opens the test databsase
USE customer && Not opened exclusively
USE employee IN 0 EXCLUSIVE && Opened exclusively in another work area
IF ISEXCLUSIVE( )
REINDEX && Can only be done if table opened exclusively
ELSE
WAIT WINDOW 'The table has to be exclusively opened'
ENDIF
SET EXCLUSIVE &cExclusive

nick patel
 
Nickpatel,

if the table is already been opened somewhere else, and then you try to open it exclusively, you will get an error message.

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top