4

The LA Fox Developer Newsletter
February 1998
In the Fast Lane
by Brad Drury

VISUAL FOXPRO MIGRATION SOURCEBOOK CD

This free interactive guide is designed to make upgrading to
Visual FoxPro 5.0 easier, addressing the two biggest concerns
developers have when upgrading: The learning curve and the
operating system. There is plenty of in-depth information on
everything from Visual FoxPro’s features to using Visual FoxPro
to build client/server and Internet applications. For ordering
information visit http:IMww.microsoft.com/vfoxpro/

MSDNFIash, Volume 2, Number 3, February 9, 1998


The Codebook News

A new publication forVFP is currently available to the FoxPro
community FREE of charge. .. .TCN is not just for Codebook
folks.
To subscribe to The Codebook News, surf to http://
www.sawysolutions.com

*__ VFUG January Newsletter (2/1/98)
Rebuilding Your Index Tags
from Scratch Without Losing
Your Primary Key, Candidate
Keys, or Persistent Relations
by Christian Berrigan
[Ed. Note: Christian Berrigan is an independent database
consultant. His company, Spartacus Development, provides
custom database solutions using FoxPro and Visual FoxPro,
including dynamic databased web sites using West Wind's
Web Connection. Hosting for VFPANeb Connection driven web
sites is also available.]

Rebuilding a .cdx from scratch (DELETE TAG ALL, then
rebuilding each tag) will delete all your persistent relationships
in the .dbc, and if you haven’t stored your PRIMARY and
CANDIDATE index metadata, as well as testing for it when
rebuilding your index tags, all your index tags will be type
‘Regular’.

At first, it’s easy to just think we’ll rebuild index tags without
deleting them first. But sooner or later, we know we will have to
rebuild them from scratch. Here’s some ideas about how to
solve this challenge.
MICROSOFT OFFICE UPDATE SITE NOW AVAILABLE
http://wnw microsoft. corn/office!

The Microsoft Office Update Web site provides new tools, user-
designed help files, interactive tutorials and the latest news
about Office 97, all for free.

*__ Exploring Windows(R) News - 1998, Issue No. 2


JANUARY 1998 PLATFORM SDK AVAILABLE
http://www.microsoft.com/msdn/sdk/bldenv.htm

Microsoft’s 1998 Platform SDK is a one-stop shop for download-
ing current and emerging Microsoft technologies as well as
tools, headers, libs and sample code.

*__ Microsoft Windows(R) Technology News -1998, Issue No. 2


You may subscribe to a variety of informative newsletters by
going to the Personal Information Center:
http://register.microsoft.com/regwiz/personalinfo. asp
**
Assumes you already have a table of metadata, Including
Index tag names, Index expressions and If — —
**
an index is a primary or candidate index
BEFORE YOU DELETE TAGS AND REINDEX, CAPTURE THE RELATIONS
IN THE .DBC SO YOU CAN RESTORE THEM LATER.
USE myoatabase.DBC AGAIN SHARED IN 0 ALIAS zDBC
SELECT *, RECNOØ AS ‘RECORDNO’;
FROM zDBC;
WHERE UPPER(ALLTRIM(objecttype)) == ‘RELATION’;
AND IDELETEDO;
INTO CURSOR zRels

--PUT YOUR REINDEXING METHOD HERE AND INCLUDE THE FOLLOWiNG
CODE:


alndexExpr is an array SELECTed from the metadata file where

Columni = TAG NAME [from TAGO]
Column2 = INDEX EXPRESSION [from SYS(14) and SYS(2021)]
plus a ## tag indicating If the Index Is a
##CANDIDATE## [from CANDIDATEO]

or ##PRIMARY## key [from PRIMARY()]
IcTable Is already USED EXCLUSIVELY and SELECTed

DELETE TAG ALL
FOR x=1 TO ALEN(alndexExpr,1)
&& rebuild each tag
m.clndExpr = ALLTRIM(alndexExpr[x,2])
DO CASE
CASE ‘##PRIMARY#f $ m.clndExpr
m.clndExpr = STRTRAN(m.clndExpr,’##PRIMARY##’,”)
IcExpr = (ALLTRIM(alndexExpr[x,1]))
ALTER TABLE (IcTable);
ADD PRIMARY KEY &lcExpr TAG (ALLTRIM(alndexExprfx,1J))
CASE ##CANDIDATE## $ m.clndExpr
(Con’t, page 5)
Page 4

4