General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only