Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem deleting a record in an open table..
Message
De
22/11/2006 20:12:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
22/11/2006 20:07:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
Divers
Thread ID:
01171965
Message ID:
01171966
Vues:
8
>I've always had problems deleting a record from an open table.
>
>Here's the code:
>
>
>dele
>gfile=juststem(dbf())
>use in &gfile
>use &gfile in 0 alias gfile exclusive
>select gfile
>pack
>use
>
>
>And I get error file is in use in the 4th line. *sigh*
>
>Help pls.

Hi Evelyn,

Perhaps the table is open somewhere else - by the same user, or by another user.

You should not do a PACK every time you delete a record. This is slow, and it will not allow for shared access.

PACK is meant to be done (for example) once a month, in a maintenance routine.

Instead, use SET DELETED ON to hide deleted records.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform