Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: CloneCursor
CloneCursor
Posted: 2008/03/14 03:58
 
Hi!

I'm trying to use the CloneCursor.
Wenn I edit this cloned cursor (edit...post) the process runs without any message, but the correction will not be saved.

cursor2.CloneCursor(cursor1, false);
cursor2.edit;
cursor2.fieldbyname('f1').AsString := 'new value';
cursor2.post;

Database: MSAccess

Please help me!

kla
Re:CloneCursor
Posted: 2008/03/14 09:19
 
CloneCursor will not work for TADQuery. It works only for TADClientDataSet.
Re:CloneCursor
Posted: 2008/03/14 09:30
 
Thanks!
Yes, it is a TADClientdataset.
Re:CloneCursor
Posted: 2008/03/14 10:40
 
It does not copy Adapter property value.
Re:CloneCursor
Posted: 2008/03/14 11:08
 
Thanks!!!!!!!!

So it is ok:

cursor2.CloneCursor(cursor1, false);
cursor2.Close;
cursor2.Adapter := cursor1.Adapter;
cursor2.open;

Strange! In AnyDAC demo (fCloneCursor.pas) is without copy of Adapter, and unfortunatly there is no documentation.

Thanks again!
Re:CloneCursor
Posted: 2008/03/14 12:45
 
I have one more (perhaps studip) question:
After editing to cloned cursor how can I the changes synchronize with the "parent" cursor?
- it does not work automatic
- refreshrecord hilfs, but only for the current record
- refresh of parent cursor causes a GPF
- reconcile ...? -no result
- ...?
Re:CloneCursor
Posted: 2008/03/15 06:44
 
Actually, both cursors refers to the same physical record storage.
So, just try to call Resync([]).