How to fix a broken database as a result of a corrupt memo file?

The bad news is that the tools to fix memo fields do not work that well.A  The fastest way to get the site running without error is to create a new data file.A  Below are the steps to take when the file wws_items.dbf becomes corrupt.A  If you have manually updated the inventory file with special prices or other data all of this data is now gone.A  You will have to have us restore from a backup which is done on a weekly basis.

* find the path of the file you need to correct by opening the 'stores' table
USE d:\countercat\wwstore\wws_stores.DBF SHARED

* search for the store record by using the 'virtual' name and show just the field wwsitems hit escape when done to close browse window
BROWSE FOR [sitename]$virtual FIELDS datapath

* store the record number of the store file for quick reference down below
lnRecno = recno()

* change the current foxpro directory to the clients main data directory
set default to allt(datapath)

* open an empty version of the wws_items inventory file
use d:\wconnect\countercat\data\newstore\wh\wws_items shared

* create a sub folder with todays date below the clients current data folder
md 031111

* change to the new sub folder
cd 031111

* create a copy of the empty inventory file
copy structure to wws_items with production

* update the stores configuration with the reference to the new database file
use d:\countercat\wwstore\wws_Stores shared

* open the wwsitems field and manually update
browse field wwsitems for recno()=lnrecno

* now change the path of the file to include the 031111 like this:A  d:\wconnect\CLIENTNAME\data\031111\wws_items.dbf

* close database and exit

Was this answer helpful? 0 Users Found This Useful (4 Votes)