Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Becomes Invisible After PACK.
Message
From
29/09/1998 08:49:50
 
 
To
29/09/1998 08:37:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00141685
Message ID:
00141870
Views:
22
>I have a simple grid tied to a table and a command button to delete the current record. If I just mark the record as DELETEd, the grid shows the record as marked. However, if I issue a PACK, the grid immediately disappears. It does not matter whether I am removing the record or keeping others.
>
You might try blanking the RecordSource property while you're doing it, then setting it again after you're done. Maybe issue an occasional Refresh() on the grid too
>If I use an ADD button on the screen, a record is added to the table, but the grid will still not redisplay unless I restart the application. Any ideas?

When you PACK the file, the grid loses its RecordSource and thus appears blank. It´s better to use SET DELETED ON, and to try to reuse deleted records for new insertions. (In our framework, before adding a record we look for a deleted one, and we RECALL it; this prevents the table from growing too much.)
This is true, but it also contributes easily to inconsistant dataset, and since that is something one can protect database from in the .dbc, it might cause problems that are hard to locate;
example: if user clicks on new/add button, you don't really have anything to look for in the deleted section of the table, and you don't have a clue what input he/she will provide for the new record. Therefore I go for a secure new record each time, that I know hasen't been used before, occasional pack doesn't bother me...
Danijel
Previous
Reply
Map
View

Click here to load this message in the networking platform