Migration problem going from TDACDSDataTable to TDAMemDataTable

Variant(True) = -1

so it won’t work for comparison with 1
Untitled

in your case, filter bool=1 can be changed to (bool <> 0)

fyi: we moved away from =1
cause if it is going to be a conditional define then that will always be something that needs to be set with every reinstall and will get us into trouble sometime…

but another day another problem:
we (historically) use DxMem datasets also
in a specific case i have code like this:
dxMem.loadfromdataset(tdaCDS)
so now this is dxMem.loadfromdataset(tdaMEM)

the problem i’m seeing now is that when using tdaCDS, the string fields that had a blanc in them (so ’ ') became an empty string in the dxmem.field
with tdaMEM this is no longer true, a space becomes a space in dxmem.field
which is offcourse the desired behaviour but this makes me run into problems now…
so i’m wondering if that was a known issue or not?

thx,
marc

Hi,

I think, it was something (option, property, etc) in CDS or DevEx that caused that behavior.

well i guess it was CDS than cause i only changed the class to tdaMem instead of tdaCDS
all other code remained the same
i don’t recall that prop

another problem
i’m linking a child to a master table
the child table has a filter before linking
with tdaCDS this works but in tdaMEM not
is there a reason for this?

procedure TDAMemoryDataset.SetMasterFields(const Value: string);
begin
if (Value <> ‘’) and (Filter <> ‘’) then DatabaseError(SNoDetailFilter, Self);

Hi,

I don’t remember why it was added but probably some issues were detected.
why you can’t disable filter, setup master and enable filter?


probably it was a “replica” of ADO:

procedure TCustomADODataSet.SetMasterFields(const Value: WideString);
begin
  if (Value <> '') and (Filter <> '') then
    DatabaseError(SNoDetailFilter, Self);
...

sorry it’s the master table that is filtered at that moment… not the child
i will work around it that way but i don’t see the necessity of it?
this worked with tdaCDS…
migrating to tdaMEM is not that straightforward …

when we’ve created MEM we used ADO and IBX as an examples of TDataset implementation so some restrictions were come from it …

strange choice since clientdataset resembles more tdaMEM than ADO not?
and i would have expected more compatibility towards tdaCDS…

CDS was closed system that was a client for their midas.dll …
probably nowadays something was changed …

at least nobody complained about such issues of TDAMemoryDataset for 14 years :slight_smile:

sure and if i wouldn’t have to migrate cds to mem i wouldn’t complain either :slight_smile:

ok another issue
in CDS: master - child linked on child->master pk
when we changed in the child the master pk it disappeared from the link, so when i changed all master pk’s the child.recordcount becomes 0 for the master i was processing
MEM does this not, i can change all masterpk’s in the child and still all childs are there…
why doesn’t the link filter out the changed childs?

or otherwise put, how do i get the child table to refresh when i change the masterlink field…

hi Evgeny, can you have a look at my last issue? i’m kinda waiting on advise to have the child table resync with the master…

Thanks, logged as bugs://85205

Hi,

pls update uDAMemDataset.pas as

procedure TDAMemoryDataset.RecordNotification(Buf: PMemDatasetrecord_Native; Operation: TMemDataSetNotification);
..
      mdnModify:
..
         else if FilterMasterRecord_OneRecord(Buf) then begin
..
         end
// this block was added
         else begin  
           RecordNotification(buf, mdnDelete);
           Exit;
         end;
// end block
      mdnDelete:

ok thx
i guess this will be in the next release?

bugs://85205 got closed with status fixed.

yes, it will