Brothers who have used Rs.GetRow all know that Rs.GetRow can obtain small-capacity data more efficiently (not suitable for large-capacity data, especially when it involves large objects, it is easy to break, so I exploded once). PuterJam is well used.
But Rs.GetRow returns a two-dimensional array, and we often don't know which segment is right and which segment. This is very troublesome, so I compiled a small program for debugging:
Dimds
SetobjRS=objConn.Execute("SELECT*FROM[blog_Upload]WHERE([ul_Quote]LIKE'%"&CStr(ID)&"%')")
ds=objRS.GetRows
objRS.Close()
SetobjRS=Nothing
'Create a table
Response.Write"WrittenBySipo(www.dc9.cn)<tablealign=""center""border=""1"">"
Response.Writevbcrlf
Response.Write"<tr><td></td>"
Forj=0ToUBound(ds,1)
Response.Write"<td>ds("&j&",X)</td>"
Next
Response.Write"</tr>"
'Each line
Fori=0ToUBound(ds,2)
Response.Write"<tr><td>ds(X,"&i&")</td>"&vbcrlf
'Each column
Forj=0ToUBound(ds,1)
Response.Write"<td>"
IfIsNull(ds(j,i))Then
Response.Write"Null"
Else
Response.Writeds(j,i)
EndIf
Response.Write"<br>"
Response.Write"<b>ds("&j&","&i&")</b>"
Response.Write"</td>"
Next
Response.Write"</tr>"&vbcrlf
Next
Response.end
--------------------------------------------------------------------------------
Dedicated to the rookies:
About GetRows:
ADO also provides more efficient methods to obtain data. The GetRows method returns a two-dimensional array variable, each row corresponds to a record in the Recordset, and each column corresponds to a field in the record. The syntax of this method is as follows:
varArray=rs.GetRows([Rows],[Start],[Fields])
Rows is the number of records to be read; if you want to obtain all records in Recordset, you can use -1 or omit this parameter. Start is a bookmark indicating the first record to be read; it can also be one of the following enumeration constants: 0-adBookmarkCurrent, 1-adBookmarkFirst, or 2-adBookmarkLast.