Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting records
Message
 
To
05/05/2003 01:22:37
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00784786
Message ID:
00784918
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi everybody.
>For deleting records from the batch file, I use following code
>
>SELECT filename
>SET ORDER TO fieldname
>SET KEY TO expr
>GO TOP
>SCAN
>	DELETE
>ENDSCAN
>SET KEY TO
>SET ORDER TO
>
>I have tested it and it works, but I am not 100% sure if the code is safe? Somewhere in my mind I have a doubt, because I am filtering the records, then fetching the records one by one and deleting it. Will SCAN...ENDSCAN lose the reference of the records as any time? Am I going to confuse the fox in any case? What are the other safe ways? I cannot use DELETE ALL FOR.., because the tables and on the network and this will lock the entire file.
>Thanks.

Your code looks good, sometimes I have used:
DO WHILE SEEK(lcSomeKey)
DELETE
ENDDO
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform