Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fixing a corrupted index.
Message
 
 
À
03/03/2003 00:22:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00760233
Message ID:
00760276
Vues:
16
John,

That fixed it. Here's what I did in case you're interested.

1. zapped all development tables with indexes.
2. copied all the cdx files into a subfolder of the data folder and renamed them .scdx (keep these files on user pc's from now on)
3. set up a loop to access every table with an index and run the following

* Form Method - indexbuild
* var - TableName holds name of table to reindex
* 1. Delete the CDX file if it exists (and the backup CDX exists)
* 2. Copy the backup CDX into the original data directory
* 3. Reindex the table

***************************************************************************
lcFullName = gcdatapath + TableName + ".DBF"
lcCdxFile = gcdatapath + TableName + ".CDX"
lcsavepath = gcdatapath + "savedcdx\"
lcsavcdxfile = lcsavepath + TableName + ".SCDX"

THISFORM.errfound = .F.

THISFORM.lblaction.CAPTION = "Reindexing table - " + ALLTRIM(TableName) ;
+ ", please wait..."

=Sleep(.5*1000)

IF FILE (lcFullName)
IF FILE (lcsavcdxfile)
IF FILE (lcCdxFile)
DELETE FILE (lcCdxFile)
ENDIF

COPY FILE (lcsavcdxfile) TO (lcCdxFile)

IF NOT THISFORM.errfound
USE (lcFullName) IN 0 EXCLUSIVE
REINDEX
USE
ENDIF
ENDIF
ENDIF
***************************************************************************

Thanks again.
Chris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform