Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating relations in the DBC
Message
From
01/02/2006 18:45:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092608
Message ID:
01092657
Views:
18
>Does anyone know how to remove DBC Relations? (in program code)
>Also,
>Does anyone know how to set DBC Relations? (in program code)
>
>I would like to add a reindex program to my app... but the way I'm doing it requires that I remove the relations first... and add them back in later.

The code to remove the relation:
ALTER TABLE 'tableNameHere' DROP FOREIGN KEY TAG tagNameHere
To add a relation:
ALTER TABLE 'tableNameHere' ;
   ADD FOREIGN KEY TAG tagNameHere ;
   REFERENCES parentTableHere TAG parentPrimaryKeyTagHere
You'll have to create all the primary keys separately (the syntax is not exactly the same as for Index On... Tag), and I assume you're destroying the .cdx files and clearing the zero bit on the 28th byte of the table header, and are also removing the primary key entries from the binary memos in the dbc.

You also need to take care that all the primary keys are created before you start adding relations. Obviously, I already have a generator which does this all :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform