Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views and deleted records
Message
 
 
To
04/03/1999 15:23:25
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00194164
Message ID:
00194246
Views:
18
This *feature* almost bit me as well. I put a non-parameterized local view in the DE of a form with a private DS. It just so happened, that the first record of the base table was deleted. I kept wondering why this record displayed in the form until I realized that all my SET commands do not fire until AFTER the tables are opened in the DE (I normally handle all this setup in the LOAD). Therefore, every one of my forms always have the big four commands in the BeforeOpenTables method [SET TALK OFF, SET DELETED ON, SET EXCLUSIVE OFF, SET MULTILOCKS ON].

>Bret ---
>
>The answer to this question depends GREATLY on whether or not it's a local view or remote view and a number of other factors.
>
>Local view: If SET DELETED is OFF, you are right, a view returns deleted records from the source table with no indication that they are deleted. You could always add a logical flag to the base table to indicate deletion status and set this flag when a record is deleted. Then when you REQUERY() the view, do an automatic DELETE WHERE to the view based on that flag so that the records look and feel the old-fashioned deleted way (With SET DELETED OFF, of course)
>
>Remote view: Once a TABLEUPDATE() is issues, most server databases "disappear" the record and it's lost forever. The trick is to *not* update the back-end for deleted records until you're sure they will be deleted. How you implement this depends on the process you're following for UI and biz logic.
>
>
>>This may seem an easy question, but I would like to know this. I have an updateable view, the user lls up the record and deletes it. A save is done and then the view updates the main table. The main table reflects that the record is deleted. Now the user wishes to chnage their mind and recall the record, but when the view runs again the data is shown but there is no indication that this record (1 of 10 in the view) is deleted. Is there a way to have a view return records showing deleted and not deleted records.
>>
>>TIA
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform