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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find if table is open by another user

Status
Not open for further replies.

newtoclarion

Programmer
Jul 20, 2011
66
0
0
SA
Hello everybody

I wan to Find if a certain table is open by another user without trying to open or access that table.

Best Regards

 
Hi!

Without trying to open or access the table, it is difficult to find if it is use. But the below code will work to find out if some other user has the file already open.

Code:
OPEN(<Table>, 12H)
IF ERRORCODE() = 05 ! Access Denied
   !open by another user
ELSIF ERRORCODE()
   !some other error
ELSE
   !open with exclusive access
END

CLOSE(<Table>)

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top