Recommended: Detailed explanation of the calling methods and usage methods of HTML online editor HTML online editor does not need to know how to use Dreamweaver. If you know how to use Word, you can use this editor. It is very practical in web programs that require text editing in article systems or news systems. But how to embed the html editor into the web page and how to obtain the data inside? ! First, we assume that the HTML online editor we want to call is placed in a separate page.
Everyone should know that Recordset has a GetRows property, but not many of them are actually used, and I have only used it recently! sweat……
In fact, this property is very simple, it is to output the data set into an array. But it is quite practical. Here I will give you an example to illustrate how to use GetRows. You can think of more usages by learning from one example and learn from it!
For example, a classification table T_Cate, the structure and data are as follows:
ID | Title | Intro
--------------------------------------------------------------------------------------------------------------------------------
1 | News | Here is the news
2 | Tutorial | Here is the tutorial
3 | Download | Here is the download
OK, the table is established and the data is also available. Now we will use GetRows!
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
OK, the table data has been exported to the array! Next we will iterate through this array
Dim Arr_CateNumS,Arr_CateNumI
Arr_CateNumS=Ubound(Arr_Cate,2) 'Get subscript of 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
Haha, OK, the output data is:
ID: 1 | Title: News | Introduction: Here is the news
ID: 2 | Title: Tutorial | Introduction: Here is the tutorial
ID: 3 | Title: Download | Introduction: Here is the download
Okay, so much to write! The literary talent is not good. If you don’t understand anything, just use it more, haha
Attachment: Source 51Windows.Net
GetRows method
Restores multiple records of the Recordset object into the array.
grammar
array = recordset.GetRows( Rows, Start, Fields )
Return value
Returns a two-dimensional array.
parameter
Rows Optional, long integer expression, specifying the number of records to be retrieved. The default value is adGetRowsRest (-1).
Start optional, string or long integer, calculates the bookmark of the record at the start of the GetRows operation. The following BookmarkEnum values can also be used.
Constant description
AdBookmarkCurrent starts with the current record.
AdBookmarkFirst starts with the first record.
AdBookmarkLast starts with the tail record.
Fields Optional, variant, representing a single field name, sequential position, field name array, or sequential position number. ADO returns only the data in these fields.
illustrate
Use the GetRows method to copy records from Recordset into a 2D array. The first subscript identifies the field, and the second subscript identifies the record number. The array variable will automatically be adjusted to the correct size when the GetRows method returns data.
If the value of the Rows parameter is not specified, the GetRows method automatically retrieves all records in the Recordset object. If there are more records requested than available records, GetRows returns only the number of available records.
If the Recordset object supports bookmarks, you can specify which record the GetRows method will start to retrieve data by transferring the Bookmark property value of the record.
To restrict fields returned by GetRows calls, you can transfer a single field name/number or field name/number array in the Fields parameter.
After the call to GetRows, the next unread record becomes the current record, or if there are no more records, the EOF property is set to True.
Share: Questions about ASP's date calculation Returns the date when the specified time interval has been added. DateAdd(interval, number, date) Parameter interval Required. A string expression that indicates the time interval to be added. For values, see the Settings section. number Required option. Numeric expression, indicating the number of time intervals to be added. Numeric expressions can be positive (get future dates) or negative (