General information
Category:
Forms & Form designer
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only