Board index » delphi » Foreign and primary key do not match

Foreign and primary key do not match

Hi all, here it is:

I try to dbiDoRestructure in order to add a new field. Nothing new, it
worked before quite nicely, using as template the example from help file or
one of the examples floating around.

The problem is that now, when using the same function that used to work OK,
it says "Foreign and primary key do not match" when calling the actual
dbiDoRestructure.

The table is Paradox, has already several indexes and is both referenced and
referred, tied with ref. integrity checks. No passwords. One memo field in
table. The table is quite loaded (8 Megs) but the structure is rather simple
(18 fields before the operation). The repair utility said the table is all
OK. When using DBD to make the same change on same table it succeeds without
comment.

Does anybody know what happens there?

Thank you, Florin

P.S. If relevant: When obtaining the FldDescs, the iFldNum (the one that
gets set from 1 to number of fields in every example) is COMING from
dbiGetFieldDescs in a very strange status (values way out of range and not
in order).
Is this normal (or nobody ever bothered to check  :-) ?

 

Re:Foreign and primary key do not match


Quote
>I try to dbiDoRestructure in order to add a new field. Nothing new, it
>worked before quite nicely, using as template the example from help file or
>one of the examples floating around.

>The problem is that now, when using the same function that used to work OK,
>it says "Foreign and primary key do not match" when calling the actual
>dbiDoRestructure.

>The table is Paradox, has already several indexes and is both referenced and
>referred, tied with ref. integrity checks. No passwords. One memo field in
>table. The table is quite loaded (8 Megs) but the structure is rather simple
>(18 fields before the operation). The repair utility said the table is all

When you have a referential integrity link the liked to field is stored by
postilion so if you insert a new field changing the position of the referential
integrity linked field you will get this error.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Foreign and primary key do not match


Thank you for answering.

The new field is added at the end of the structure, so the order of the
original fields is not changed (or shouldn't be).

Florin

Quote
Brian Bushay TeamB wrote in message <371af025.46932938@floyd>...
>When you have a referential integrity link the liked to field is stored by
>postilion so if you insert a new field changing the position of the
referential
>integrity linked field you will get this error.

>--
>Brian Bushay (TeamB)
>Bbus...@NMPLS.com

Other Threads