Creates a duplicate Recordset object that refers to the original Recordset object.
Syntax
Set duplicate = original.Clone
The Clone method syntax has these parts.
Part |
Description |
duplicate |
An object variable identifying the duplicate Recordset object you're creating. |
original |
An object variable identifying the Recordset object you want to duplicate. |
Remarks
Use the Clone method to create multiple, duplicate Recordset objects. Each Recordset can have its own current record. Using Clone by itself doesn't change the data in the objects or in their underlying structures. When you use the Clone method, you can share bookmarks between two or more Recordset objects because their bookmarks are interchangeable.
You can use the Clone method when you want to perform an operation on a Recordset that requires multiple current records. This is faster and more efficient than opening a second Recordset. When you create a Recordset with the Clone method, it initially lacks a current record. To make a record current before you use the Recordset clone, you must set the Bookmark property or use one of the Move methods, one of the Find methods, or the Seek method.
Using the Close method on either the original or duplicate object doesn't affect the other object. For example, using Close on the original Recordset doesn't close the clone.
Notes
? | Closing a clone Recordset within a pending transaction will cause an implicit Rollback operation. |
? | When you clone a table-type Recordset object in a Microsoft Jet workspace, the Index property setting is not cloned on the new copy of the Recordset. You must copy the Index property setting manually. |
? | You can use the Clone method with forward-only–type Recordset objects only in an ODBCDirect workspace. |