Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting records in a buffered view.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00578650
Message ID:
00595777
Vues:
20
I'm surprised VFP even lets you do a pack without buffermode being set to 1. But yes, you're better off not doing a pack after each deleted record. BTW, when you want to post code, it's much more readable if you surround it with < pre > < /pre > tags (without the spaces).

>Robert, the following is the code I finally used this morning to make this work. You are correct about TableUpdate(). I do execute that inthe .SaveIt() function as you will see below in the cmdPackTable procedure:
>
>* Pack table now. Only security level 3 may pack this table.
>Local llGood
>WITH ThisForm
> IF .IsChanged()
> .SaveIt()
> ENDIF
> IF .nSecLevel > 2
> IF USED('Address')
> USE && Close the file.
> ENDIF
> USE address EXCLUSIVE
> SELECT Address
> WAIT WINDOW NOWAIT "Packing table..."
> llGood = CursorSetProp('Buffering', 1, 'Address') && Turns off buffering.
> PACK
> USE
> USE Address ORDER lfName SHARED && Re-open table in SHARED mode.
> llGood = CursorSetProp('Buffering', 2, 'Address') && Pessimistic row buffering.
> .cmdDelete.Enabled = .T.
> .cmdRecall.Enabled = .F.
> .IsDeleted()
> .CountRecs()
> ENDIF
> *.Refresh() && Don't need this command since it is in .CountRecs().
>ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform