When using VB, I found a strange problem, as shown below: Code In the process of generating recordset, the clone method of recordset is called. No operation is performed after the clone, during tracking and time, it is found that the recordset's recordcount for rectemp is 26, but after calling the recordset clone method, it was found that the new Zookeeper rectempcopy After cloning has doubled the rectemp record. Depressed, is there a doubling of the clone capacity? Query msdn. As described above,
UseCloneMethod to create multiple, duplicateRecordsetObjects, special if you want to be able to maintain more than one current record in a given set of records. UsingCloneMethod is more efficient than creating and opening a newRecordsetObject with the same definition as the original.
The current record of a newly created clone is set to the first record.
I don't know how it works?Depressing. I checked out msdn:
Changes you make to oneRecordsetObject are visible in all of its clones regardless of cursor type. However, once you execute requery on the originalRecordset, The clones will no longer be synchronized to the original.
Closing the originalRecordsetDoes not close its copies; nor does closing a copy close the original or any of the other copies.
You can only cloneRecordsetObject that supports bookmarks. Bookmark values are interchangeable; that is, a bookmark reference from oneRecordsetObject refers to the same record in any of its clones.
Checked againCloneAfter the principle, the author of the blogDream of daily InjuryDescriptionClone:To obtain a superficial copy is to directly connect the book to the reader, and to obtain a deep copy is to save (or destroy) the book and copy it to the reader ().
in C #, the copy method of dataset is deep copy, and the clone method is just pull clone.
code:
dim objprv as object 'sysrrvb. clspprv
dim objrectemp as new ADODB. recordset
dim objrectempcopy, rectempcopy1 as new ADODB. recordset
dim strtemp
set objprv = Createobject ("'sysrrvb. clspprv ")
if me. chkdep. value = 1 then
set objrectemp = m_buffer.records (clng (mid (trim $ (Me. trvorg. selecteditem. key), 2, 1)
set objrectempcopy = Objrectemp. clone
set rectempcopy1 = objrectemp
******
end if
the clone method has a lot of details, but I still don't know why double is the original clone object ?, In addition, the added object is not exactly the same as the original object .?