Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Using BLANK records as new records?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00032970
Message ID:
00033450
Vues:
40
>>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

Hi Todd,
I believe if you check the documentation, INSERT - SQL does momentarily lock the table header in order to update the record count contained in the header. But you are right, INSERT INTO is much superior to APPEND BLANK. However, I normally use buffering on the table instead of moving data from the controls to the table, then issue a TABLEREVERT() if the user Cancels the record addition.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform