Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is a table bound expression?
Message
De
23/07/2002 13:40:42
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
23/07/2002 09:16:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00681586
Message ID:
00681796
Vues:
28
Will-

>I have a little reindex routine which bascially does the following
>
>scan through all dbf files in a folder
>deletes the .CDX file
>A)select * from "Original" into Table temptable
>B)recreates the CDX on temptable
>C)Copy To "Original" With Cdx Type Fox2x
>D)Use In Select("temptable")
>endscan
>
What is the goal of this routine? To down-version a DBF table to Fox2X format?

I would probably go a different route of creating the Fox2X table, then once you're sure it's good, delete the original and rename the new file to the old name. I don't know if that's applicable to your goal, though.

Since the SELECT statement opens "Original", the COPY TO shouldn't be expected to work unless you've first closed Original. Again, you could just rename the TempTable files to Original after closing everything. That way you won't have any access conflicts.

Try something like the following example:
CLOSE DATABASES ALL

*!* This gives us a common table to use for the example
CREATE TABLE TestTable ( ID I )
INDEX ON ID TAG ID
USE IN TestTable
*!* ---------------------------------------------------

LOCAL ai[1], lni, lnTags, lcExpr
USE TestTable
COPY TO NewTable TYPE FOX2X
lnTags = ATAGINFO(ai,"TestTable.cdx",'TestTable') && What tags do we need to recreate?
USE NewTable
FOR lni = 1 TO lnTags
	lcExpr = ;
		"INDEX ON " + ai[lni,3] + " " +;
		"TAG " + ;
		LEFT(ai[lni,1],10)
	&lcExpr
NEXT lni
USE IN NewTable
DELETE FILE TestTable.* RECYCLE
COPY FILE NewTable.* TO Products2X.* WITH CDX
DELETE FILE NewTable.* RECYCLE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform