Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting records from a view
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00345193
Message ID:
00345290
Views:
26
>>>I'm sure there is an easy solution to this, but I need your help. When I delete a record from a local view, I do a tableupdate() and a requery() but the record still shows as if it were there. If I try to delete it again, I get an "Update Error". If I exit the application then look again, it is gone. I tried the update with the force flag, same thing. What is the proper way to do this? I am using optimistic row buffering.
>>>
>>>TIA
>>
>>If you dont have SET DELETED ON before you requery your view (or initially get it) then I think deleted records will come over. So if you get your data into a view and delete a record, save the view, then rwquery and set deleted is off then you will get back the deleted record, but with set deleted on you should not. Try this out please and check my assumptions. HTH
>
>Thanks Bret, but I have set Deleted On all of the time in this application. I've also discovered the same problem when I add a record. The can see the record as long as long as I don't requery. As soon as I do a Requery() it doesn't show. Now when I exit the application the restart it's now OK. I've tried everything (except the right thing). I deleted the local view and re-created it. I verified that "Send SQL Updates" is checked. My primary key is checked and all fields are checked to be updated. If anyone has any ideas please let me know
>
>TIA

Well that was my shot at it, but I wonder if you can or have done a messagebox showing what deleted is at the moment when you are viewing the records (messagebox(SET('DELETED')). I found in my past that I thought the deleted was ON, when I actually had code or the lack of code that turned it off before my method was fired. Not to say you have not tried it, just a suggestion. It is a cotcha that bit my rear end off before. The other thing is can you brind up the view in the command window and open it in a browse and delete a record, send the update and requery it. Does everything show up OK. I use the command window a lot to check that my views are behaving properly.
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