Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REINDEXING FILES
Message
From
27/10/1998 00:15:32
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00148929
Message ID:
00150782
Views:
29
>I want to have a program that re-inexes all the tables. I set exclusive on and then close all tables. Then I open each one exclusive and issue a reindex command. I get the message that the file is already open & it isn't open exclusive. What should I be doing?
>
>
>Thanks.

Here a sample of what I do sth like that !!


SET SYSMENU OFF
SET TALK ON WINDOW
SET NOTIFY ON
CLOSE DATABASES ALL
SELECT SELECT(1)
USE database.dbc EXCLUSIVE NOUPDATE
GO TOP
COPY TO ARRAY tablelst FIELDS objectname FOR objecttype = "Table"
USE

SET EXCLUSIVE ON
OPEN DATABASE database EXCLUSIVE VALIDATE

FOR i = 1 TO ALEN(tablelst)
WAIT WINDOW "Packing & Re-indexing " + ALLTRIM(tablelst[1,i]) + "..." NOWAIT
SELECT SELECT(1)
cmd = "USE " + ALLTRIM(tablelst[1,i])
&cmd
PACK
REINDEX
ENDFOR
WAIT WINDOWS "Pack & Re-index completed ..." NOWAIT

SET TALK OFF
SET NOTIFY OFF
SET EXCLUSIVE OFF
CLOSE DATABASES ALL
OPEN DATABASE database SHARED
SET SYSMENU ON

RETURN


Regards

Xavier
Previous
Reply
Map
View

Click here to load this message in the networking platform