Something like:
local lnfp
lnfp=fopen(file_name,2)
if lnfp>0
=fclose(lnfp)
else
* File is in use by somebody
endif
>I am opening a file with the EXCLUSIVE clause. If someone else is using the file, I immediately get an error, "File access is denied". I thought that there might be some way to trap this error, but there appears to not be one. I placed an ON ERROR ThisForm.ExclusiveError() function after the "USE TableName EXCLUSIVE" command, but it is never executed; the FoxPro error appears first.
>
>Does anyone know of a way to accomplish the purpose of detecting that the file is already open elsewhere? I want to do some reindexing (rebuild index tags), which the user/administrator executes from a form with a grid of a list of tables. I want to alert the user tyhat someone is still using the open file and that he cannot have exclusive access yet.
>
>Cecil
Previous
Next
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