AliR,
Here is a sample from the CodeBase VB Users Guide that you should have
installed with CodeBase (folder "books"). The sub that creates a
relation from the tables "student" and "enrollment" looks as follows:
> Function SetRelation1( )
> master = relate4init( student )
>
> If master = 0 Then
> SetRelation1 = False
> Exit Function
> End If
>
> slave = relate4createSlave( master, enrollment, "ID", idTag )
> rc = relate4type( slave, relate4scan )
> rc = relate4top( master )
> If rc = r4success And Not cbError( ) Then SetRelation1 = True
> End Function
So, as you can see, the crucial function to connect two tables in a
relation is "relate4CreateSlave".
Hope that helps!
Markus


|