Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't close table!
Message
De
17/03/2011 04:42:09
 
 
À
16/03/2011 09:28:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01503862
Message ID:
01503950
Vues:
43
John,

Sergey and Naomi gave you the answer to your specific question. Since this select is used to fill a grid, I will quickly present what I think is the best way to do this in a form. In the form's LOAD:
Select ..ListOfFields.. from yourtable where .F. ;
   into cursor CursorWithAMeaningfulName readwrite && Create an empty updatable cursor with correct structure
Index on field2 tag field2 && Create the index tags you will need later, if any
Index on field2 tag field2
When you select the data:
Select ..ListOfFields.. from yourtable where ..SomeCondition.. into cursor CurDummy
yourform.lockscreen=.T.
Select CursorWithAMeaningfulName
zap
append from dbf('curDummy')
yourgrid.refresh()
yourform.lockscreen=.F.
With this solution you never disconnect the grid from the data source, so you don't have to reset any grid values. And since you don't create any tables, there's no cleaning up to be done.

>I create a table with:
>SELECT * from parts WHERE ponum=mponum INTO TABLE partstank.dbf
>
>After using this table as a record source for a grid, I can't get the thing to close no matter what I do, and no matter where I do it! Is there any way apart from USE to close a table?
>
>The code I have tried is:
>SELECT partstank
>use
>
>Also tried:
>
>USE in SELECT("partstank")
>
>After trying to close the file, I try to delete the file with:
>DELETE FILE('partstank.dbf')
>and get a VFP error "File in use..."
>
>ANY ideas welcome!
>Thanks!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform