NEXTRECORDSET and GETROWS are very small! Recently used, good good stuff! It is very effective for improving bulk queries and querying records. NEXTRECORDSET and GETROWS are the two properties of Recordset (attribute or way I often confuse this, unclear, fifth, un) GetRows ---> Take the RecordSet record set into a two-dimensional array, we have the Recordset data The behavior is transferred to the array, can disconnect the record early, no longer use the metadata operation, rs.Movnext, while not qi, etc. can be saved. NextRecordset ----> is a way to submit multiple queries, forming multiple REORDSET results sets, providing a Recordset that leaves the current work, transferring to the second Recordset method! Mainly the result of the result set formed in multiple SELECTs.
Examples are as follows: DIM SQL, RS, ARRA, ARRB, ROWSA, ROWSB '====== Extract Database Library Record ==== (AdoDb.Connection) SQL = "SELECT CA1 , CA2, CA3, CA4 from Tablea "" --------------- Selectasql = SQL & "SELECT CB1, CB2, CB3, CB4, CB5 from Tableb" ------- ------ SelectBSet RS = conn.execute (SQL) 'Execute result will have two Select's result set, the current first SELECT RECORDSET is active ARRA = rs.getrows' ------- --- Get the two-dimensional array of Selecta RecordSet SET RS = RS.NEXTRECORDSET '------------ The most critical step, activate the next Recordsetarrb = rs.getrows' ----- ----- I get the second selectb recordset's two-dimensional array = nothing '--------- Release the database object as soon as possible, close the record set Conn.closset conn = Nothing, all of us About the data dry net extraction of the database is completed, use the earliest time to release the database resource '--------- //' ======== With the acquired ARRA Arrb for page processing, Display data results ====== 'Note, Arra = obtained after getRows, first dimension is the representative column, the second dimension represents row ROWSA = UBOUND (arra, 2)' ---- Extract the second The dimension is equivalent to obtaining the number of records of Recordset, ROWSB = Ubound (Arrb, 2) '-----, extracting the second dimension of Arrb' Data loop: 'The first SELECT table loop Response .write "