Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views and deleted records
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00194164
Message ID:
00194471
Views:
18
>>Adding deleted() to one of the fields in my view did no reflect a .T. when the view was called up and requeried. The field always indicated a .F., I think the function deleted() is being evaluated after the set is created and by then the select statment has already created the cursor and the record is not deleted in the cursor. If you experiment with it and find this wrong I would like to know. What I did to experiment was to go to the view designer in the
>
>Ok... here is what I did...
>
>open data MyDataBase
>set deleted off
>create view testdel as select *,deleted() as Deleted from mytable
>
>modi view testdel
>
>I made it updateable, and set the where to key fields only. Make sure the deleted column isn't set as modifyable. Save the view Then...
>
>use MyTable
>browse
>
>Mark a few rows deleted
>
>use
>
>now:
>
>use testdel
>
>Ok... this is where it gets tricky... the deleted field should be T for those records marked deleted... however, the records are not deleted in the view.
>
>So, you can't recall the record in the view and do table update. Code your system so that if someone presses the Undelete button you do the following code...
>
>recall for id=iCurrentRecordID in MyTable
>requery()
>
>When I did this, the deleted field changed from T to F.
>
>Keep in mind... if the buffer is dirty you may want to do a tableupdate. Or, you might want to wait until the user presses save, then do your tableupdate, then do your recalls.
>
>I just tested it, and it does successfully tableupdate() changes made to the deleted records.

>
>HTH,
>BOb

I will try this, but the monkey wrench in this is that I use the view designer in the database to create and maintain my views. You have the statment DELETED() as deleted, how can this be accomplished using the view designer versus creating it on the fly. I can get around this but I am just curious. I will test you steps shortly.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform