Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: Fred Cohen
  Where is Fred Cohen?
 Moorestown
 New Jersey - United States
 Fred Cohen
 Tags
Subject: RE: Test for Table Open
Thread ID: 33620 Message ID: 33622 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Sunday, November 30, 2003 10:15:35 PM         
   


> I know that there are several functions ,like USER() , that allow a method to test whether a table is open in a specific work area. Can anyone tell me if there is any function that will test for whether a table is open in any work area whatever?
>
> Fred888

You can try to USE the table in EXCLUSIVE mode:
lcOldErr = ON("ERROR")
lnError = 0
ON ERROR lnError = ERROR()
USE yourtable EXCL
ON ERROR &lcOldErr
DO CASE
	CASE lnError = 0
		* ok
	CASE lnError = 3 
		* File Is In Use
	CASE lnError = 1750 
		*1705: Access Denied
	OTHERWISE
		* something else is wrong. Raise error!
		ERROR(lnError)
ENDCASE

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

ENTIRE THREAD

Test for Table Open Posted by Fred Cohen @ 11/30/2003 8:39:23 PM
RE: Test for Table Open Posted by Eric den Doop @ 11/30/2003 10:15:35 PM
RE: Test for Table Open Posted by Yuri Rubinov @ 12/1/2003 3:00:39 PM
RE: Test for Table Open Posted by suhas hegde @ 12/1/2003 3:36:09 PM
RE: Test for Table Open Posted by Yu-Wah Cheung @ 12/4/2003 12:36:45 PM