Solved

MIDAS - Nested? ClientDataSets

Posted on 1998-11-26
15
263 Views
Last Modified: 2010-04-04
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
Comment
Question by:Odie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
15 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348007
Odie,

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

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

Zif.
0
 
LVL 1

Author Comment

by:Odie
ID: 1348008
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
 
LVL 1

Author Comment

by:Odie
ID: 1348009
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:ZifNab
ID: 1348010
and the dataset is set into edit mode?
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1348011
May I know why you use MIDAS since data is loaded from local files?
0
 
LVL 1

Author Comment

by:Odie
ID: 1348012
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
 
LVL 1

Author Comment

by:Odie
ID: 1348013
Adjusted points to 400
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1348014
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1348015
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
 
LVL 1

Author Comment

by:Odie
ID: 1348016
I'll have a look.
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1348017
Ok, any progress, leave me a message.
I'm also concerning about this topic(as well as the points ^_^)
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1348018
Hi, how are things going?
0
 
LVL 1

Author Comment

by:Odie
ID: 1348019
Sorry, forgotten.  I've worked around it.  Guess you were right, you can as well answer it now.
0
 
LVL 4

Accepted Solution

by:
dwwang earned 400 total points
ID: 1348020
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
 
LVL 1

Author Comment

by:Odie
ID: 1348021
By using CloneCursor to make another CDS which didn't have the other table as master;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question