Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Readonly on Table Open
Message
From
02/11/2005 15:34:34
 
 
To
02/11/2005 14:55:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01064050
Message ID:
01064707
Views:
11
>>>>>What would force a table to be opened with READONLY=.T.? I am performing the following command:
>>>>>
>>>>>USE (pcFileName) IN 0 AGAIN ALIAS mytable SHARED
>>>>>
>>>>>This is being executed in the Init method of a form with the variable 'pcFileName' being passed as a >lparameter.
>>>
>>>>>Is it a real table? Is it open somewhere else? If yes, what is the mode? Do you have a read-write access to
>>>>>that file?
>>>
>>>The table is a form (scx), it is not open anywhere else and I have read-write access. I can open the form with >>the MODIFY FORM command; but if opened via my form Init method as above it is being opened readonly.
>>>
>>Are you passing it with the full path and extension? I just tried in command window
>>
>>USE GETFILE('scx') IN 0 AGAIN ALIAS mytable SHARED
>>
>>it woirked just fine.
>
>There is a full path to the file. I can open (USE) the form, but it is READONLY. I have worked some more with this and it seems it is intermitten (do not know what's causing the behavior). So, my question is what would cause a readonly on a USE command? From the documentation of the USE command there is not an option for opening in READONLY mode (just SHARED or EXCLUSIVE). I can open the form normally with MODIF FORM so I know that the file is not marked READONLY (and can see from attributes in Win Explorer).
>
>I would expect that the only way to have READONLY on a table (in this case a USEd form) is if the file attribute is READONLY; are there any other ways?

USE yourfile NOUPDATE will open the file READONLY. And if you open a file multiple times, by USE xxx AGAIN, VFP will check how you opened the table first, and open it again in the same way. So if you have USE xxx NOUPDATE anywhere in your code, and this line is the FIRST time you open the table without closing it, all subsequent USE commands will open the table READONLY.
Previous
Reply
Map
View

Click here to load this message in the networking platform