Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get foreign keys
Message
From
08/06/2022 06:01:10
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
08/06/2022 02:06:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01684430
Message ID:
01684477
Views:
43
Hi Thomas,

I looked into that in the 90's, found that I need multiple (named) DBC's per program and never touched the whole MODI DATA again. I have a own meta system that fit's better to my needs all the time. I use own code that deals with this on business level. I have a kind of dynamic relationships, where two fields define the target and target table, this is all to complex for those builders. So I stuck with my RI - SQL solution 25 years old. :)

The problem is with a friend who uses Visual Extend. He's not very deep into this, and the framework uses this builder stuff, and he has asked for help. So I was able to figure out what was gone and what to recreate, but died on the DBC.RIINFO or ADBOBJECTS(laArray,'Relation') 5th column.
As Al suggested one can circumvent this by carefully copying the DBC. So just creating all what one can create and then copy an old version of the DBC over it, looks like all fits.

I end up fixing the CDX and VALIDATE DATABASE until he could open the crap and run it's framework's repair/update against it, and all was fine.

Lutz

>Hi Lutz,
>
>Hint for quick fox AND lazy dog: Do not use the DBC generated RI.
>I read you don't use Stonefield and from the thread guess you don't use xCase as well -
>Look inside the old Booth / Sawyer foxpro book - it has SQL based RI code easier to follow.
>Steve is still around - drop him a line if you don't have the book...
>
>my 0.22€
>thomas
>
>>My problem is referential integrity.
>>Open a database with foreign keys using OPEN DATA .. EXCL, then MODI DATA. Right click a relationship (the line), select "Edit Relationship integrity".
>>
>>There are three pages where you can set referential integrity for the relationship. To do this using code is the goal.
>>
>>You get the actual setting using ADBOBJECT(laArra,'RELATION'), as Tamar suggested, but how to set?
>>
>>Tip:
>>Help on ALTER TABLE ... ADD FOREIGN KEY is wrong anyway. COLLATE is placed wrong. See https://github.com/VFPX/HelpFile/issues/18
>>
>>I do not use that, but a friend comes up with a corrupted database made by a framework that creates this stuff. I know what to set, but not how, and on IDE it is a no go. To many elements.
>>
>>Lutz
>>
>>Update:
>>The field in the DBC, RIINFO, has a description as .. used by the Referential Integrity Builder (in 60dbc.frx) but automatically used by VFP.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform