Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to release tables from memory.
Message
 
À
04/11/1999 17:48:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00287227
Message ID:
00287231
Vues:
19
>The following code exist in one of my menu options. At the beginning of the code, everything in &curdrive\cds\output is deleted. Once this code is completed, the screen clears and the user can select from the menu. If they select the same menu option, the error occurs "File is in Use". At the end of the code, the database table are still in use. How do I release just those tables from memory?
>
>Of course when I exit out of the program completely and go back in to process, it works just fine.
>
>=========
>
>SET DIRE TO &curdrive\cds\output
>DELETE FILE *.*
>SET DIRE TO &curdrive\cds
>...
>...
>...
>...
>...
>
>SELECT zonelist
>SCAN
> tmpzone = zone
> tmpfile = "zone" + alltrim(tmpzone) + ".dbf"
> tmpfile2 = "zone" + alltrim(tmpzone) + ".txt"
> set dire to &curdrive\cds\output
> SELECT 0
> SELECT "&tmpfile"
> COPY TO "&tmpfile2" type delimited
> set dire to &curdrive\cds
> SELECT zonelist
>ENDSCAN

Pamela:

The easy way to fix this is to put the command USE after the COPY TO command.

I'm going to assume that you typed this from memory rather than cut and paste the actual program because there is no USE (tmpfile) to open the DBF and there is no SET DIRE TO command in VFP. (Maybe it should be SET DEFA TO.)

There are other ways to accomplish what you've got here, but we'll just take care of your problem for now.
-cjh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform