We should all know that the Recordset has a GetRows attribute, but the real use is not much, I also recently used!
In fact, this property is very simple, that is, the dataset output to an array. But the practicality is not small, here I give an example to explain GetRows use method, everybody extrapolate can think of more usage!
For example, a categorized table t_cate, structure and data are as follows:
ID | Title | Intro
-----------------------------------------
1 | News | This is the news.
2 | Tutorials | Here is the tutorial
3 | Download | Here is the download
OK, the table is established, the data also has, below we will use to getrows slightly!
Dim rs_cate
Dim arr_cate
Set rs_cate=conn.execute ("Select Id,title,intro from T_cate order by ID ASC")
Arr_cate=rs_cate.getrows
Set rs_cate=nothing
Okay, all right. Table data has been exported to an array! Below we'll iterate over this array
Dim Arr_catenums,arr_catenumi
Arr_catenums=ubound (arr_cate,2) ' Gets the subscript of the data in the array
For Arr_catenumi=0 to Arr_catenums
Response.Write ("ID:" &arr_cate (0,arr_catenumi) & "| title:" &arr_cate (1,arr_catenumi) & "| Introduction:" &ARR_ Cate (2,arr_catenumi) & "<br>")
Next
Oh, well, the output of the data is:
id:1 | Title: News | Introduction: Here is the news
Id:2 | Title: Tutorials | Introduction: Here is the tutorial
Id:3 | Title: Download | Introduction: Here is the download
Well, specifically write so much! Literary talent is not good, if we have what do not understand, more use on it, hehe