• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

MIDAS - Nested? ClientDataSets

I'm trying do to something very simple - but I'm stuck.

I'm using 3 TClientDataSets CDS1, CDS2 and CDS3.
I'm not connected to a server or something.  It's just local, loaded from files.

CDS1 is the master of CDS2
CDS2 is the master of CDS3

It works fine for CDS1 and CDS2 but when I try adding CDS3 total chaos rules.

I figured out this probably is a nested dataset, I figured out I need to use TDataSetFields and a Provider but I just can't find out how.

Can anyone help me on this?
0
Odie
Asked:
Odie
  • 7
  • 6
  • 2
1 Solution
 
ZifNabCommented:
Odie,

I guess you'll find everything you need in this paper :

http://www.inprise.com/midas/papers/technical/

Zif.
0
 
OdieAuthor Commented:
Nope.  I didn't find the information I need in there.  Thanks anyway.

I did some more research on the problem and the problem starts when I add lookup fields (no problem with calculated fields).  And I don't need to use the Provider or TDataSetFields stuff, I suppose.


0
 
OdieAuthor Commented:
Nope.  I didn't find the information I need. Thanks anyway.

I did some more research on the problem and found that it occurs when I add lookup-fields (calculated fields don't give the problem).

Everything works alright without them.  (But I need them.)

The error occurs when trying to edit CDS3.  It says "DataSet not in Edit or (Insert?) Mode."
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ZifNabCommented:
and the dataset is set into edit mode?
0
 
dwwangCommented:
May I know why you use MIDAS since data is loaded from local files?
0
 
OdieAuthor Commented:
It seems to be handy.  Lookup stuff etc.  I do not need to distribute the BDE.  Future extension are possible - in case I really will need MIDAS.

and to Zif:
Active = true
State = dsBrowse

and it's only CDS3 which gives the error
CDS1 & 2 are in the same state and there's no problem editing them

when I try editing CDS3 a second time, I get a stack overflow (even after restarting the program, and not clearing the dataset).

BTW - have you tried putting up a simple form with my configuration?  Does it work?
0
 
OdieAuthor Commented:
Adjusted points to 400
0
 
dwwangCommented:
Hi, I have written such kind of programm before, and seems have no problem, although not in TClientDataSet. Would you made it more specific, or e-mail a sample code to me?

e-mail: dw-wang@263.net
0
 
dwwangCommented:
Hi, sorry for the delay.

I found out the problem is that you use lookupfield as the same field with the masterfield. Seems this is not allowed in ClientDataSets.

I tried with TQueries, and found no problem.
0
 
OdieAuthor Commented:
I'll have a look.
0
 
dwwangCommented:
Ok, any progress, leave me a message.
I'm also concerning about this topic(as well as the points ^_^)
0
 
dwwangCommented:
Hi, how are things going?
0
 
OdieAuthor Commented:
Sorry, forgotten.  I've worked around it.  Guess you were right, you can as well answer it now.
0
 
dwwangCommented:
Glad to here that! So how did you work it around, by using another field for lookup?

Merry Christmas and happy new year!

Regards,
Wang
0
 
OdieAuthor Commented:
By using CloneCursor to make another CDS which didn't have the other table as master;
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 7
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now