Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Using BLANK records as new records?
Message
 
À
20/05/1997 12:47:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00032970
Message ID:
00033427
Vues:
41
>I want to use up all the BLANK records that were made with a APPEND BLANK but never used. I do not want to PACK. What do I search for when looking for BLANK records?
>
>SCAN FOR empty(myfield)
>IF FOUND()
> GOTO RECNO()
> THISFORM.REFRESH()
>ENDIF
>ENDSCAN

2 points

1st if you want to do this why not

delete for empty(myfield)
pack

and 2nd why are you using append blank. This is a bad strategy as it is slower, requires a temporary lock of the table header which can lead to problems in a big multiuser environment and you end up with blank records when there is an error.

What I do is store all data for new records in the controls. When the user commits to adding the record use the

insert into mytable (field1,field2 etc) values (thisform.control1.value, etc)

Insert into doesn't lock the table header, is faster than append and you don't end up with blank records.

HTH
Todd Burstain, MD
infinitydoc@delphi.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform