Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for active users ?
Message
From
10/07/2001 15:09:21
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00470266
Message ID:
00528837
Views:
33
Ed,


Trapping exclusive use could be as easy as:


LOCAL cOldErrorHandler, lOpenSuccess
lOpenSuccess = .t.
cOldErrorHandler = ON('ERROR')
ON ERROR lOpenSuccess = .F.
USE Blah blah woof woof EXCLUSIVE
ON ERROR &cOlderErrorHandler
IF ! lOpenSuccess
* It failed
ENDIF

I'm trying to open a database exclusively in a .exe file and tried to modify your code above to test for success and can't seem to get it to work.

Here is the last thing I tried:

ON ERROR DO errlog WITH ERROR(), MESSAGE(), ;
MESSAGE(1), PROGRAM(), LINENO(1)
LOCAL cOldErrorHandler, lOpenSuccess
lOpenSuccess = .t.
cOldErrorHandler = ON('ERROR')
ON ERROR lOpenSuccess = .F.

OPEN DATABASE DATA\oppsarea EXCLUSIVE
ON ERROR &cOlderErrorHandler
IF NOT lOpenSuccess
do remove_checkfile
ENDIF


What I want to be able to do is remove a certain file from the database if I can't open the database exclusively. I also tried putting my do remove_checkfile in my errlog procedure put I can't get that to work either.

Keith
Previous
Reply
Map
View

Click here to load this message in the networking platform