paradox foreign keys problem!

I'm using paradox foreign keys from a delphi application.

On borland's site I found a code snippet for creating
foreign keys which has following signature:

procedure AddRI(Master, Detail: TTable;
              RIName: string; ModOp, DelOp: RINTQual);

It is located somewhere on borland's site.

To use the procedure both tables should be opened with
an index that contains fk fields, and all works fine
except in the following case:

table1 has pk (f1, f2) and table2 has pk (f1, f2),
which is also it's fk

I create index iFK on fields f1 and f2 of table2, open
table1 with it's pk, and table 2 with iFK. Than I call
AddRI and get the following error:

"Foreign and primary key do not match."

I have also tried opening both tables with their pk and
using AddRI, but to no avail.
Of course adding RI constraint through database desktop
works without problems.

Any help appreciated.