Recent

Author Topic: Link two tables  (Read 2568 times)

Emmanuel

  • New Member
  • *
  • Posts: 24
Link two tables
« on: September 19, 2014, 08:43:27 am »
I have 2 tables (dbf, tables) linked by a commun field. I have difficulties to create the link between these 2 tables and create a MasterFields, have you got any example to help me  ::) 


Thank you for your help

Emmanuel :D

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Link two tables
« Reply #1 on: September 19, 2014, 08:53:31 am »
What have you done already.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

Emmanuel

  • New Member
  • *
  • Posts: 24
Re: Link two tables
« Reply #2 on: September 19, 2014, 09:02:29 am »
Almost nothing  :'(, I just create a form with 2 tables : I can see the data in my tables and also used a DBnavigator to move inside my table but I would like to link these 2 tables, it should be easy, but I m stack


Thank you for your support

wdn

  • New Member
  • *
  • Posts: 12
Re: Link two tables
« Reply #3 on: September 19, 2014, 11:48:16 am »
Does the relation work between 2 DBgrid objects?
Start making an excercice as explained in wiki.freepascal.org/masterdetail

Wim

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Link two tables
« Reply #4 on: September 19, 2014, 06:29:23 pm »
Attached is a simple project that illustrates a very simple master-detail TDBF setup.
Most of the settings are done explicitly in code rather than using the Object Inspector, so you can see the important properties and indexes that need to be set up. Otherwise these settings may be overlooked in the Object Inspector (or are more hidden in the form's .lfm file).
Best practice is to use a datamodule to contain your data objects and files, but that is omitted from this example for simplicity.

 

TinyPortal © 2005-2018