Information générale
Titre:
USE EXCLUSIVE becomes READONLY
We've encountered the following problem with VFP (that wasn't there with FPW)...after doing a USE (filename) EXCLUSIVE successively, the "readonly" attribute of the DBF gets set on.
The following sample program demonstrates the problem. When we run it with two FPW programs, its fine; if we run it with VFP 5.0 and FPW 2.6, very rarely (1000's of attempts) the VFP version succeeds in its USE statement but IsReadOnly() returns TRUE. If we stop at that point and LIST STATUS, we see:
Currently Selected Table:
Select area: 1, Table in Use: C:\BOGUS.DBF (Readonly) Alias: BG
Code page: 0
Lock(s): Exclusive USE
This is the same result you get if you said:
USE bogus.dbf EXCLUSIVE NOUPDATE
Here's the program we've used. Anybody have any thoughts?
Don Krasnick
*------------------------------------------------------
* bogus.dbf is an FPW 2.6 free table with a single numeric field
*------------------------------------------------------
SET EXCLUSIVE OFF
PUBLIC gotAnError
DO WHILE .T.
gotAnError = .F.
ON ERROR DO GotError
USE c:\bogus.dbf ALIAS bg EXCLUSIVE
IF gotAnError
?"Error"
ELSE
IF IsReadOnly()
WAIT WINDOW "Oops!!!"
ELSE
REPLACE seq WITH seq + 1
ENDIF
USE
ENDIF
ENDDO
RETURN
PROCEDURE GotError
ON ERROR
gotAnError = .T.
ON ERROR DO GotError
RETURN
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement