FoxPro Programming
Re: Packing Web-Connect System Files
Feb. 28, 2012
07:44 pm
Gratar Image based on email address
From: Rick Strahl
To: Simon White
Hi Simon,

There's no real good way to do this if you're running multiple instances because of VFP's requirement for exclusive use - if more than one instance is running tables can and usually are open in more than one session adn you can't re-index properly. In order to reindex/pack properly you need to put the server into single instance mode and then run the maintenance operations.

What I've done to automate this is to basically drive the requests remotely through HTTP. All the operations are accessible via HTTP links, so I use wwHttp to hit first the link to put the server into single instance mode

DO wwhttp loHttp = CREATEOBJECT("wwhttp") loHttp.cUsername = "ricks" loHttp.cPassword = GetSystemPassword() *** Put server into single instance mode (COM only) lcOutput = loHttp.HttpGet("") *** Now call a server link that runs your admin task lcOutput = lcOutput + loHttp.HttpGet("") lcOutput = lcOutput + loHttp.HttpGet("") *** Put the server back into multiserver mode lcOutput = lcOutput + loHttp.HttpGet("")

Now compile that PRG into an EXE and fire hook it up to task scheduler for specific times when traffic is low or non-existant.

+++ Rick ---


I wonder what people are doing in regards to automating the packing and re-indexing of the Web-Connect system files. I usually just go to the admin page every so often and re-index the tables but I would prefer to automate this so it just happens. Would anyone like to share how they handle this?


Rick Strahl
West Wind Technologies

Making waves on the Web

from Maui, Hawaii