Board index » delphi » Problem with DbiDoRestructure Example 9 (Add referential integrity)

Problem with DbiDoRestructure Example 9 (Add referential integrity)

Delphi 2.01 - BDE 3.0 - Paradox 7

Hello

I use the example 9 of DbiDoRestructure found on
www.borland.com/devsupport/bde/bdeapiex.
to create a Cascade Modify RI.

PROBLEM :
When modifying the parent field, cascade modify don't work, there is a crash
and I have the following message :

Quote
>Violation d'accs l'adresse F9D482C5. Lecture de l'adresse F9D482C5

(Access violation at ...)

WHY :
Because of the secondary index on child field in the child table.
If I create manually the RI with Database module, without index on the child
field, it works.

BUT :
The example say :

Quote
>The (child) table must be opened exclusively on the index that the RI is

going to be placed on.
If there isn't the index on the child field, the AddRI function don't work.

QUESTION :
How to modify the AddRI function to create a RI on a field without index on
it ?
I hope it is possible because we can do it manually...

NOTE :
No problem with Restrict modify.

Marcus

 

Re:Problem with DbiDoRestructure Example 9 (Add referential integrity)


Quote
Marc Pleysier wrote:

> Delphi 2.01 - BDE 3.0 - Paradox 7

> Hello

> I use the example 9 of DbiDoRestructure found on
> www.borland.com/devsupport/bde/bdeapiex.
> to create a Cascade Modify RI.

> PROBLEM :
> When modifying the parent field, cascade modify don't work, there is a crash
> and I have the following message :
> >Violation d'accs l'adresse F9D482C5. Lecture de l'adresse F9D482C5
> (Access violation at ...)

> WHY :
> Because of the secondary index on child field in the child table.
> If I create manually the RI with Database module, without index on the child
> field, it works.

> BUT :
> The example say :
> >The (child) table must be opened exclusively on the index that the RI is
> going to be placed on.
> If there isn't the index on the child field, the AddRI function don't work.

> QUESTION :
> How to modify the AddRI function to create a RI on a field without index on
> it ?
> I hope it is possible because we can do it manually...

> NOTE :
> No problem with Restrict modify.

> Marcus

Hello,
  This should work OK.  Try it on another set of tables.  What happens
with the Database Desktop is that it creates secondary indexes on teh RI
fields so you often don't see that it is necessary.

  Scott
--
BDE Support:
 http://www.borland.com/devsupport/bde
Delphi Support:
 http://www.borland.com/devsupport/delphi
Common Delphi and BDE Questions and Answers:
 http://www.borland.com/devsupport/delphi/qanda/delphi3qa.html

Re:Problem with DbiDoRestructure Example 9 (Add referential integrity)


I have the problem on all set of tables.
The AddRI function doesn't create a secondary index.
The secondary index must exist before the AddRI call. If it doesn't, the RI
is placed on the field of the primary index.
If the secondary index exits, AddRI works but there is a crash when cascade
modify. Delete the secondary index and the cascade modify still don't work.
Create manually the RI without secondary index and the cascade modify work.

Marcus.

Re:Problem with DbiDoRestructure Example 9 (Add referential integrity)


Quote
Marc Pleysier wrote:

> I have the problem on all set of tables.
> The AddRI function doesn't create a secondary index.
> The secondary index must exist before the AddRI call. If it doesn't, the RI
> is placed on the field of the primary index.
> If the secondary index exits, AddRI works but there is a crash when cascade
> modify. Delete the secondary index and the cascade modify still don't work.
> Create manually the RI without secondary index and the cascade modify work.

> Marcus.

Hello,
  I ran the example on the Customer Orders tables in the DBDEMOS
directory and it works fine with cascade modify.  Can you tell me what
field type and size you are trying to create this RI on??

  Scott
--
BDE Support:
 http://www.borland.com/devsupport/bde
Delphi Support:
 http://www.borland.com/devsupport/delphi
Common Delphi and BDE Questions and Answers:
 http://www.borland.com/devsupport/delphi/qanda/delphi3qa.html

Other Threads