Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Packing in a cursor
Message
From
18/02/2003 15:28:40
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00754536
Message ID:
00754623
Views:
17
>>Is it possible to completely remove deleted records from a cursor? Pack gives me an error that the operation is not available for a cursor (or something like that).
>>
>>-The cursor is a view based on a SQL Server 7 view.
>>-The user initially sees an empty grid (cursor) for listing selected names (curSelected). They then select names from another list that get added to and removed from the curSelected cursor. Kind of like a mover class, except using grids instead of list controls.
>>-I have Set Deleted On and Private DataSession
>>-In my grids, I use the RecNo() function to set the backcolor of each row. When there is a deleted record, the two records before and after it display the same backcolor. This is confusing to the user, because they cannot see the deleted record.
>>
>>Thanks in advance for any help with this!
>>
>>Don
>
>You cannot pack the cursor by design, so you should use some other way to do what you want. Another way to get rid of the deleted records would be to COPY TO another table where you will get only not deleted records, and then substitute the original view in the grid with this table. But I don't know how it fits into your scheme of things. May be you can use SELECT... INTO TABLE instead of the view and use that table as the grid.recordsource and PACK it as you wish.


Nick,

Thanks for the ideas!

I got it to work by selecting into a local array, requerying the SQL7 cursor for 0 records (where 0=1), then append from array back into the cleared cursor.

Works like charm.

Regards,

Don
Previous
Reply
Map
View

Click here to load this message in the networking platform