Re: Master-detail don't work??? (MasterField type Date/Time)




Seems that I can't do such a simple and straightforward thing, for which
even an example is given in the docs (and which I've already done
before). Two tables in master-detail relation shown in two DBGrids.

When I run the app, the master table is shown OK; the detail grid is
empty (I made sure that the table itself is NOT empty).
When the app is not running, in the form designer, the detail DBGrid
shows data (the tables are open).

What on earth could be wrong here? I did the following:
On the detail table:
- set the MasterSource to the datasource of the master table
- set the MasterField to the field Timestamp, which is primary key in
the master table and is present in the detail table (one-to-many, so not
a primary key there)

The field tht links the tables (primary key on the master table) is of
type Date/Time (MS Access). Could it be that fields of that type cannot
be used to make master-detail relationship?...

I'd be thankful if anybody could suggest what might be wrong.
DateTime fields can be problematic because in some databases milliseconds get
dropped when the value is saved. However if you see the master and detail
linked up in IDE then it should work at runtime.
Are you sure the detail table is Open at Runtime.
Are you modifying any of the TadoTable properties of the master or detail at
runtime?
For a check I suggest you create a new project and then copy your TadoTables
,TadoConnection, Tdatasets and TdbGrids to a form in the new project and see if
it works there. If it does you are making some change in code that is affecting
the link.
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.



Relevant Pages

  • Re: Search Form - Take 2
    ... While in Design mode, highlight all of the fields you want to include in the ... selected fields to the primary key. ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)
  • Re: Search Form - Take 2
    ... selected fields to the primary key. ... description column in Recommendations or Accomplishments you'll have some ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)
  • Row cannot be located for updating
    ... I have a master table and a detail table. ... (autoincrement field and primary key in MasterTable) ... with the proper ID value! ... I've just discovered that even the primary key of MasterTable ...
    (borland.public.delphi.database.ado)
  • Re: Master-detail dont work??? (MasterField type Date/Time)
    ... The field tht links the tables (primary key on the master table) is of ... type Date/Time. ...
    (borland.public.delphi.database.ado)
  • Re: Row cannot be located for updating
    ... Both primary keys in MasterTable and DetailTable are Autoincrement field ... But the problem seems to be on the Primary key fields, ... > The master linking field in the detail table needs to be of type Integer ...
    (borland.public.delphi.database.ado)