Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleted record shows in my form. It shouldn't
Message
 
À
26/01/2013 02:47:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01564108
Message ID:
01564211
Vues:
43
>>>>>>>>>>Simple form, one table.
>>>>>>>>>>
>>>>>>>>>>Set delete is on in the init of that form.
>>>>>>>>>>
>>>>>>>>>>First record of that table is deleted but is shows in the form.
>>>>>>>>>>
>>>>>>>>>>When records other than the first one in that table are deleted they don't appear in the form as expected.
>>>>>>>>>>
>>>>>>>>>>Anyone can help me with this weird behavior?
>>>>>>>>>
>>>>>>>>>What if you GO TOP of the table after the SET DELETED?
>>>>>>>>
>>>>>>>>This works... but I don't like it
>>>>>>>>
>>>>>>>>I never put a GO TOP before in any form. Why the heck that problem occuring now?
>>>>>>>
>>>>>>>Because current record is cached on VFP internal data.
>>>>>>
>>>>>>Maybe FLUSH would work ?
>>>>>
>>>>>I doubt it, and it would be wrong.
>>>>>Because the record still exists in the file,
>>>>>and a developer must go on to RECALL it,
>>>>>the VFP team can not move the record pointer
>>>>>without an explicit program command.
>>>>
>>>>Flush as I understand it clears any buffers and writes the changes to disk. Doing that should update the caches. Of course the record would exist as a deleted record. Honestly, I haven't tried it, but if flush works as advertised, it should update the cache and resolve the issue if it is in fact a cache problem as you suggested.
>>>
>>>The fact is that in this case there is not an simple update data cache,
>>>but the record should disappear from the cache.
>>>If that happened, what value would take RECNO ()?
>>
>>Whatever value it would currently occupy in the table on disk.
>>What I am trying to say is that FLUSH should update the physical table on disk, and, by extension, update the buffered/cached data.
>>Perhaps a flush coupled with a grid refresh would do the trick?
>
>
>Flush has nothing to do with this. This hasn't nothing to do with buffers vs disk.
>
>SET DELETED ON
>USE mytable
>DELE
>
>Does deleting the record move the record pointer?
>
>No, the record point doesn't move, and the current record is still deleted.
>
>DELETE doesn't move the record. SET DELETED doesn't move the record pointer.
>
>Either SET DELETED ON before the table is opened, or GO TOP after you SET DELETED ON.


Agreed, I am assuming that the SET DELETED ON was issued in advance... It's part of my standard "SET" group at the start.
...which is why I suggested the grid refresh to force the issue...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform