Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleted record No. returned even with set deleted on
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01446068
Message ID:
01446121
Views:
43
Hi Gerard

there's a list here of whats reset in a private data session

http://support.microsoft.com/kb/129980



>Hi Al. Thanks for your reply
>
>I tried following:
>Setup a .Prg whcih calls the Form
>In the Prg I have:
>Set Deleted On
>Call MyForm
>........ still returns 1 as record no (i.e. Lands on the deleted Record)
>
>Then did a bit of experimenting with the form:
>If the form is set up as a Private Data Session, it returns the deleted record (even though the calling Program has Sewt Delered on)
>If the Form is set up with Default data Session, it returns record no. 2 (i.e. first Non Deleted Record)
>
>It would appear from this that Private Data Sessions dont recognize a Set on a calling Prg ??
>I wonder if its just with set('deleted') or all sets ??
>
>Regards,
>Gerard
>
>
>
>
>
>
>
>>>I am getting a deleted record no. returned even with Set Deleted On..why is this.
>>>The following will replicate it
>>>1. Set up a Table with 3 records in it
>>> Delete the First and third record
>>> From the command window:
>>> Sele 0
>>> Use MyTable Alias 'MY'
>>> Sele MY
>>> Wait window recno() This shows 2...which is as expected
>>>
>>>2. Create a new form
>>> Insert the Table --> MyTable into the Data Environment with an alias of 'MY'
>>> On A Button Click have the following:
>>> Set deleted on
>>> Select MY
>>> Wait Window Recno() This Shows 1.... landed on the deleted record ???
>>>
>>>If I code around this , by putting a Goto Top , its ok, but why is it (From the DE) landing on the
>>> deleted record. Mind you, if I click the button a second time, its ok.
>>>But first time round it is wrong, and different to what happens in the command window
>>>
>>>Maybe there is something I can put into the DE to prevent it going to the deleted record ?
>>
>>You don't say, but I suspect in your case #1 you have SET DELETED ON before any of the commands you show. IOW it's ON before MyTable is opened.
>>
>>I don't use dataenvironments on forms, but is it possible with your case #2 that MyTable is already open before SET DELETED ON is issued by the command button? ISTR that SET DELETED is like SET FILTER, in that "the condition specified by SET FILTER is not evaluated until the record pointer is moved in the table."
>>
>>One thing to try would be to SET DELETED ON before you load your form.
Previous
Reply
Map
View

Click here to load this message in the networking platform