Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record in cursor created with CA
Message
 
 
To
20/08/2010 13:03:24
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01477582
Message ID:
01477628
Views:
51
>>>>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.
>>>
>>>
>>>Then you you should use and easier way :-)))))))))))))))
>>>Every CA have a DeleteCmd property.
>>>You should made it something like that:
>>>
>>>this.DeleteCmd = "UPDATE YourTable SET Rec_Id = 'D' WHERE PK_Field = ?"+this.Alias+".PK_Field" 
>>>*** Just change PK_Field to the real name of that field
>>>
>>>
>>>Then delete your records in CA and use TableUdpdate as you wish.
>>>(this is NOT tested)
>>
>
>Borislav's suggestion is a good one. By using the the DeleteCmd property, the delete command will hide the row from the user (provided you have set delete on) and tableupdate() will send the update statement to the sql database instead of the default delete statement marking the row as deleted. One step, and all is done.
>

Thank you.
"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
Reply
Map
View

Click here to load this message in the networking platform