Solved

Cloned Dataset

Posted on 2008-06-13
6
1,111 Views
Last Modified: 2013-11-23
Hi all,

It's me again :) I have another question. I use clientdataset  in my application and i use clonecursor a lot.
My question is if i refresh a record using refreshrecord in the source dataset, why is it the record in the cloned dataset not updated? if i use refresh command, the cloned dataset will be updated.

Thanks,

Reynaldi
0
Comment
Question by:reynaldio
6 Comments
 
LVL 13

Assisted Solution

by:rfwoolf
rfwoolf earned 100 total points
ID: 21783426
Well probably because they're 2 datasets and they each have their own cursors and they each have their own recordset (otherwise, what's the point in a clone?). Think of them as two instances of the same database table. You make a change to one, the other one isn't going to know about it until it refreshes - at least that's my take on it, I could be wrong
0
 
LVL 4

Assisted Solution

by:Delphian
Delphian earned 100 total points
ID: 22021145
@rfwoolf

Actually they are 2 with two cursor but using the SAME recordset. So I believe that cds_Source.Refresh will affect the two.
0
 
LVL 9

Accepted Solution

by:
sun4sunday earned 150 total points
ID: 22141147
From Delphi Help

After calling CloneCursor, the data for the client dataset is the same as the data for Source. Edits performed by either client dataset are reflected in the data of both datasets.

Note:      Because cloned cursors are shared, changing properties that affect the cursor affect both datasets. For example, setting the ReadOnly property of either dataset will make both datasets read-only.

Call Refresh to change the base values of the current record to match the current value on the server.

clear details are in the Delphi Help
Unidirectional datasets refresh the data by closing and reopening the cursor.
Unidirectional datasets have no mechanism for locating the current record after a refresh, and always

ClientDataset is unidirectional means its a connectionless state
0
 
LVL 4

Expert Comment

by:Delphian
ID: 22142121
ClientDatasets are bidicional by nature. The provided dataset (the one that T<Anything>Provider links) which can be unidirectional.
0
 
LVL 2

Author Closing Comment

by:reynaldio
ID: 31466953
Thanks guys
0

Featured Post

Technology Partners: 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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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