Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
USE EXCLUSIVE becomes READONLY
Message
From
02/02/1999 10:32:12
Donald Krasnick
Stanton Systems and Consulting
Havertown, Pennsylvania, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
USE EXCLUSIVE becomes READONLY
Miscellaneous
Thread ID:
00182936
Message ID:
00182936
Views:
71
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
Reply
Map
View

Click here to load this message in the networking platform