Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear a view, how?
Message
From
02/08/2010 09:13:31
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
02/08/2010 04:19:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01474613
Message ID:
01474872
Views:
46
>>>Hi,
>>>
>>>Is there a generic way so that I can zap all records (already) loaded in a parameterized view without affecting the underlying source table(s) as though the view is just opened with NoDataOnLoad = .T. from the DE?
>>>
>>>My current way is try to figure out filter variables in the view and feed one of them with certain value so that when I requery() the view, that filter will cause the view to load nothing. But I am curious about whether there is a simpler and more generic way that can be applied on any parameterized view?
>>>
>>>Please, any clue will be very much appreciated!
>>
>>The correct answer: http://my.advisor.com/doc/SILVL14-01
>
>Of course, the purist can't but notice that you explicitly set safety ON, disregarding any setting in place before this code runs... tsk tsk tsk.
>
>But actually the trick is very neat and works with SPT too.

Thanks. That same purist would, despite Ceil's kindness, scold me for not resetting bufferring and sendupdates to their original values too!

Requery does much more than ZAP. I have another trick. Use Create Cursor instead of USE viewname or SPT to get an empty cursor for binding controls. The more complex the view, the better this trick performs. I have one form that loads in less than 2 seconds by doing that versus more than 10 seconds the other way. It's 4375 times faster than one of my biggest queries.
Previous
Reply
Map
View

Click here to load this message in the networking platform