Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem deleting a record in an open table..
Message
From
22/11/2006 20:12:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
22/11/2006 20:07:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01171965
Message ID:
01171966
Views:
7
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform