Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate INDEX ON / REINDEX during the night

Status
Not open for further replies.

calico

Programmer
Jan 6, 2001
26
CA
HI,

We use Foxpro for DOS 2.6

I would like to create a foxpro program (.FXP) that can execute PACK, INDEX ON .... or REINDEX instructions for all the tables in my application.

I would like to automate / schedule this foxpro program (.FXP) during the night.

Can we execute INDEX ON .... or REINDEX instructions when we are out of foxpro session ?

Thank you

Danny Danny Presse
 
You can if everyone is completely out of the files at that time.
Do a keyword search in this form on index or reindex and you will find all sorts of routines. Also, do the same for scheduler. Keep in mind that scheduler doesn't like .BAT files though.
Dave S.
 
You could even automate the whole thing with Dennis Allen's DW4.
I found it, via a sugestion on this forum, at....

You'll need a routine that runs your index program from within your existing app or using some sort of timed startup.
 
Write a program either as an *.exe or inside a session, I have done it by both methods.


* start of program
clear
start_time = "22:00:00" && starts at 10pm

do while start_time != time()
@say 10,25 "Current time " + time() + "We will start at 22:00"
enddo

* Collect all tables into an array, then zip through them all. While doing that issue your pack command, which automatically reindexes anyways

Grimwaldi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top