Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is a table bound expression?
Message
From
24/07/2002 05:29:08
 
 
To
23/07/2002 13:40:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00681586
Message ID:
00681949
Views:
24
Hi Nancy,

Thanks for your suggestions - you are right I need to add some more resilience into this routine.

The goal of this exe is a super-reindex routine.
Basically it deletes the .cdx file before even trying to open the table (I have had C5 errors and GPF's just trying to open a table with a corrupted CDX)
The entire database is in fox 2.x format so any reindexing done by VFP needs to be backwardly compatible.
It also orders the tables into their natural PK order to aid rushmore (hence the reason for the select statement).

The problem I am having is that the USE IN command does not work, it produced an error and did not close the table.

I will mention that this routine is run weekly in 500+ sites round the world without problem.. 1 site ran it, hit wierd problems and it burned their data.

So you don't know what a table bound expression is then? :)

>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
Will Jones
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform