Name
NextRecordset (Command Object, Recordset Object) —
Set
rsObj2
=
rsObj1
.NextRecordset(
lngRecordsAffected
)
Synopsis
Clears the current recordset and retrieves the next recordset. This retrieval occurs by iterating through a series of commands sent in with the call to the Recordset.Open method.
Parameters
-
rsObj2 The Recordset object variable to which you assign the recordset returned from the NextRecordset method.
-
rsObj1 The current Recordset object. This Recordset can be the same Recordset as that represented by
rsObj2. If this is the case, the current recordset is cleared. Otherwise, you will have two Recordset objects after the method call: one that represents the current Recordset, and one that represents the Recordset returned from the command.-
lngRecordsAffected The number of records cleared if
rsObj1=rsObj2.
Example
<%@ 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 = "/bc_SSIncludes/adovbs.inc" --> <% ' Instantiate an ADO Connection object. Set objDBConn = Server.CreateObject("ADODB.Connection") ' Construct the connection string for the Connection object. strConn = _ "driver={MyDBType};;uid=sa;pwd=;database=SalesDB" ' Using the connection string, open the connection. objDBConn.Open strConn ' Create a command text string. strCommandText = _ "SELECT * FROM Sales WHERE Price > 70000; " strCommandText = strCommandText & _ "SELECT ...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