Board index » delphi » Detail-Master Relationship Question

Detail-Master Relationship Question

Can anyone provide me some guidance on how to create a Detail-Master
Relationship at runtime? I have done the following and keep receiving the
error "Missing Table Property Name". db Files are dBase.

var Carfilename, DriverFileName : string[12];

  with Table1 do
  begin
    Active:= False;
    Databasename:= DataFilePath+'\';
    TableName:= CarFilename;
    Indexname:= 'CRName';
    Active:= True;
  end;
  with Table2 do
  begin
    Active:= False;
    Databasename:= DataFilePath+'\';
    TableName:= DriverFilename;
    IndexFieldNames:= 'DriverCode';
    MasterSource:=DataSource1;
    MasterFields:='DriverCode';
    Active:= True;
  end;

 

Re:Detail-Master Relationship Question


I think the problem may be that you are using the "IndexFieldNames"
property of Table2.   That usually works only with true SQL back end
databases.   Use the "IndexName" property instead.  If you don't
already have an index on Table2 by DriverCode, you will need to create
one.

Do you have a field called "DriverCode" in Table1 as well as in
Table2?    The MasterFields property of Table2 should be set to the
name of the field in Table1 that corresponds with the active index on
Table2.    It does not necessarily need to have the same name.

The error message is also a little strange.   Are you sure that the
variables for the table filenames contain the correct names (including
.dbf extension).

Regards,
Colin Acheson

On Tue, 25 Jul 2000 21:04:03 -0400, "George Kwascha"

Quote
<kas...@mindspring.com> wrote:
>Can anyone provide me some guidance on how to create a Detail-Master
>Relationship at runtime? I have done the following and keep receiving the
>error "Missing Table Property Name". db Files are dBase.

Other Threads