Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do a cursor writable?..
Message
From
24/03/2006 17:39:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01107530
Message ID:
01107537
Views:
19
>>Hi, I have these command lines:
>>
>>Select * from Mytable into cursor MyCursor
>>
>>* Then :
>>
>>Select MyCursor
>>Scan
>> If field1=1
>> replace field2 with date()
>> Endif
>>Endscan
>>
>>How to write into MyCursor? VFP tell me: Can´t write in the cursor..
>>The question is: how to do it writable?..
>>
>>Thanks in advance
>>Carlos Burgos
>
>Select has a clause readwrite or nofilter, but I can not remember in what version were they added, so, if they do not work for you, you can try after de select:
>
>
>use dbf('myCursor') again alias myWritableCursor in 0
>use in select('myCursor')
>
>select myWritableCursor
>scan
>...
>endscan
>
A word of warning about this.

VFP 6 does not support READWRITE, so Hugo's statements are what you need to do. BUT VFP 6 does support NOFILTER. If you don't use that clause, you could wind up having a filtered view to the main table and when you open the cursor again you are really opening the underlying table again WITHOUT THE FILTER. You could easily be updating records you never intended to touch.
Previous
Reply
Map
View

Click here to load this message in the networking platform