--- title: "Clone Method (ADO) | Microsoft Docs" ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.custom: "" ms.date: "01/19/2017" ms.reviewer: "" ms.topic: conceptual apitype: "COM" f1_keywords: - "Recordset20::Clone" - "Recordset20::raw_Clone" helpviewer_keywords: - "Clone method [ADO]" ms.assetid: ad49265f-1c05-4271-9bbf-7c00010ac18c author: MightyPen ms.author: genemi --- # Clone Method (ADO) Creates a duplicate [Recordset](../../../ado/reference/ado-api/recordset-object-ado.md) object from an existing **Recordset** object. Optionally, specifies that the clone be read-only. ## Syntax ``` Set rstDuplicate = rstOriginal.Clone (LockType) ``` ## Return Value Returns a **Recordset** object reference. #### Parameters *rstDuplicate* An object variable that identifies the duplicate **Recordset** object to be created. *rstOriginal* An object variable that identifies the **Recordset** object to be duplicated. *LockType* Optional. A [LockTypeEnum](../../../ado/reference/ado-api/locktypeenum.md) value that specifies either the lock type of the original **Recordset**, or a read-only **Recordset**. Valid values are **adLockUnspecified** or **adLockReadOnly**. ## Remarks Use the **Clone** method to create multiple, duplicate **Recordset** objects, especially if you want to maintain more than one current record in a given set of records. Using the **Clone** method is more efficient than creating and opening a new **Recordset** object that uses the same definition as the original. The [Filter](../../../ado/reference/ado-api/filter-property.md) property of the original **Recordset**, if any, will not be applied to the clone. Set the **Filter** property of the new **Recordset** to filter the results. The simplest way to copy any existing **Filter** value is to assign it directly, as follows. ``` rsNew.Filter = rsOriginal.Filter ``` The current record of a newly created clone is set to the first record. Changes you make to one **Recordset** object are visible in all of its clones regardless of cursor type. However, after you execute [Requery](../../../ado/reference/ado-api/requery-method.md) on the original **Recordset**, the clones will no longer be synchronized to the original. Closing the original **Recordset** does not close its copies, nor does closing a copy close the original or any of the other copies. You can only clone a **Recordset** object that supports bookmarks. Bookmark values are interchangeable; that is, a bookmark reference from one **Recordset** object refers to the same record in any of its clones. Some **Recordset** events that are triggered will also occur in all **Recordset** clones. However, because the current record can differ between cloned **Recordsets**, the events may not be valid for the clone. For example, if you change a value of a field, a [WillChangeField](../../../ado/reference/ado-api/willchangefield-and-fieldchangecomplete-events-ado.md) event will occur in the changed **Recordset** and in all clones. The *Fields* parameter of the **WillChangeField** event of a cloned **Recordset** (where the change was not made) will refer to the fields of the current record of the clone, which may be a different record than the current record of the original **Recordset** where the change occurred. The following table provides a full listing of all **Recordset** events. It indicates whether they are valid and triggered for any recordset clones generated by using the **Clone** method. |Event|Triggered in clones?| |-----------|--------------------------| |[EndOfRecordset](../../../ado/reference/ado-api/endofrecordset-event-ado.md)|No| |[FetchComplete](../../../ado/reference/ado-api/fetchcomplete-event-ado.md)|No| |[FetchProgress](../../../ado/reference/ado-api/fetchprogress-event-ado.md)|No| |[FieldChangeComplete](../../../ado/reference/ado-api/willchangefield-and-fieldchangecomplete-events-ado.md)|Yes| |[MoveComplete](../../../ado/reference/ado-api/willmove-and-movecomplete-events-ado.md)|No| |[RecordChangeComplete](../../../ado/reference/ado-api/willchangerecord-and-recordchangecomplete-events-ado.md)|Yes| |[RecordsetChangeComplete](../../../ado/reference/ado-api/willchangerecordset-and-recordsetchangecomplete-events-ado.md)|No| |[WillChangeField](../../../ado/reference/ado-api/willchangefield-and-fieldchangecomplete-events-ado.md)|Yes| |[WillChangeRecord](../../../ado/reference/ado-api/willchangerecord-and-recordchangecomplete-events-ado.md)|Yes| |[WillChangeRecordset](../../../ado/reference/ado-api/willchangerecordset-and-recordsetchangecomplete-events-ado.md)|No| |[WillMove](../../../ado/reference/ado-api/willmove-and-movecomplete-events-ado.md)|No| ## Applies To [Recordset Object (ADO)](../../../ado/reference/ado-api/recordset-object-ado.md) ## See Also [Clone Method Example (VB)](../../../ado/reference/ado-api/clone-method-example-vb.md) [Clone Method Example (VBScript)](../../../ado/reference/ado-api/clone-method-example-vbscript.md) [Clone Method Example (VC++)](../../../ado/reference/ado-api/clone-method-example-vc.md)