Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change buffering of a cursor
Message
From
26/05/2017 12:28:04
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
26/05/2017 11:56:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01651184
Message ID:
01651543
Views:
56
>>>>>>Hi,
>>>>>>
>>>>>>I am trying to ZAP records in the cursor which has the Buffering set to 5 (I tested using CursorGetProp())
>>>>>>
>>>>>>So I need to first change the Buffering to 1, right? Here is how I do it:
>>>>>>
>>>>>>
>>>>>>lSuccess = CURSORSETPROP("Buffering", 1, cViewName)
>>>>>>
>>>>>>
>>>>>>But I get a message that "The view require either db_bufoptrow or db_bufoptable" . What do I need to do?
>>>>>>
>>>>>>TIA
>>>>>>
>>>>>>UPDATE. This cursor was created as a cursor to Cursor Adapter object. But then it was detached. I suppose VFP still "considers" it as a view. So I need to learn how to change this cursor from a "view" to an ordinary cursor; so that I can ZAP it.
>>>>>
>>>>>
>>>>>Hi,
>>>>>
>>>>>In my opinion to zap a cursor is useless, just recreate the cursor from the start, vfp will overwrite the old cursor with the newly created one.
>>>>
>>>>When the cursor is the RecordSource for a grid, zapping and refilling is the way to go.
>>>>
>>>>Tamar
>>>Tamar,
>>>of course, you are correct, this is what Andy used to call a safeselect().
>>>Regards,
>>>Koen
>>
>>I used ZAP to let the user empty a cursor bound to a grid instead of re-running the query with a where 1=0 condition. That can be much faster depending on the query and the network and remote database.
>
>Mike,
>
>Your reply puzzles me. What is different to Andy's SafeSelect with your doing here described?
>
>Regards,
>Koen

Andy's safeselect is a way to re-populate a grid's cursor. He zaps it, then does a requery into a separate cursor, then appends the content of the separate cursor into the original cursor.

In my form the user can build a filter condition and execute it - which fills the cursor. To empty the cursor, I've most often seen people change the filter condition to 1=0 and re-query. When I want the grid emptied, I zap it. Then if the user queries with a different filter, the grid's cursor is filled in without any separate cursor. It's not a safe-select, it's a regular select, with an optional means of emptying the cursor.
Previous
Reply
Map
View

Click here to load this message in the networking platform