Name
Clone (Recordset Object) —
Set
rsObj2 = rsObj1
.Clone(
LockType
)
Synopsis
Creates an exact duplicate of a recordset and places that recordset into a second Recordset object variable.
Parameters
-
rsObj1 The Recordset object you wish to copy.
-
rsObj2 The new Recordset object into which you will place the copy of the Recordset object represented by the
rsObj1parameter.-
LockType Optional. The LockType parameter specifies the lock type of the original Recordset object being cloned. The possible values are
adLockUnspecified(lock type of clone will be the same as that of the original, whatever type that is) oradLockReadOnly(the original Recordset is read-only).
Example
The following example demonstrates the use of the Clone method of the Recordset object and the fact that the same bookmark values can be used in clones as in the originals to point to the same records.
<%@ LANGUAGE="VBSCRIPT" %>
<% Response.Buffer = True %>
<HTML>
<HEAD>
<TITLE>ADO Examples</TITLE>
</HEAD>
<BODY>
<%
' Include ADOVBS.INC so we can use the ADO constants.
%>
<!-- #include virtual = "/MySSIncludes/adovbs.inc" -->
<%
Dim astrFieldNames( )
Dim astrFieldValues( )
' Instantiate an ADO Connection object.
Set objDBConn = Server.CreateObject("ADODB.Connection")
' Construct the connection string for the Connection object.
strConn = _
"driver={SQL Server};;uid=sa;pwd=;database=SalesDB"
' Using the connection string, open the connection.
objDBConn.Open strConn
' Instantiate two ADO Recordset objects. Set rsSales ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access