Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record in cursor created with CA
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01477582
Message ID:
01477606
Views:
33
>>>>Hi,
>>>>
>>>>I want to delete a record in a cursor created with a CursorAdapter record but not the record in the base table (in SQL Server)? How do you do it? TIA.
>>>
>>>
>>>If you give us the reason why, maybe it will be easier to us.
>>>
>>>You could delete the record and than make something like this:
>>>
>>>DELETE
>>>thisCA.SendUpdates = .f.
>>>TABLEUPDATE(......)
>>>thisCA.SendUpdates = .t.
>>>
>>>
>>>Make INSTEAD OF DELETE Trigger in SQL Server.
>>>It depends what you want to do.
>>>Why you want to delete the records in the Frontend but not in BackEnd?
>>
>>First the explanation of why. I have a column REC_ID with the value of '0' for "non-deleted" records. When user deletes a record, I don't want to delete it but change the value of REC_ID to "D". So, on command to delete a record (user thinks he/she actually deletes), the program changes the value of REC_ID to "D", sends TABLEUPDATE(). This updates the base table and therefore on the next reload of the CA the record will not be shows to the user. But immediately upon setting the value of base record column REC_ID to 'D' I want to remove this record from the cursor. I suppose the above code you suggested should work. Thank you.
>
>You probably want to filter the records with D from the display. May be add a filtered index or some other mechanism to not show the records as you still need to get your D value back to the database.

This is not what I was asking. Please see my reply to Boris.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform