In ASP, if you use sets = Oconn.execute () to create a recordset object, and then use recordset.Recordcount to get the record number, you will find that its value is -1. At this time, we can use the Getrows method to obtain Record number.
<% Dim Oconn, Orgen, AROWS DIM I, J Set Oconn = Server.CreateObject (Adodb.Connection) Oconn.open Provider = Microsoft.jet.oledb.0; Data Source = & Server. Mappath (database/newasp.resx) Setrs = Oconn.execute (Select Top 5 Softid, SoftName From NC_SOFTList) Response.write RecordCount: & OrgencordCountCount & <br/> OWS (-1) 'ORS.EOF = TRUE, AROWS (color, row) setrs = Nothing Oconn.Close () Set Oconn = Nothing If Isarray (AROWS) then Response.write RecordCount: & Ubound (AROWS, 2) +1 & <br/> for I = 0 to ubound ( aRows,2) For j=0 To UBound(aRows,1) Response.Write aRows(j,i) If j<> UBound(aRows,1) Then Response.Write , Next Response.Write <br/> Next End If %>