I get an error when I use GetRows(adGetRowsRest). I have to use GetRows(-1)
ADODB.Recordset (0x800A0C93)
Operation is not allowed in this context.
/my_cards/set.asp, line 208
Also, I have to check for an array if the query comes back with rows, else I get a type mismatch error.
What could cause this?
Sub GetCards()
dim strSql, rs, allSRData, SetRows
strSql = "SELECT SR_CARDS FROM " & strTablePrefix & "SET_ROW " & _
"WHERE SET_ID = " & SetID & " AND SR_CARDS > 0 AND SR_ROW_TYPE = 4"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn
if rs.EOF or rs.BOF then
allSRData = ""
else
allSRData = rs.GetRows(-1) 'adGetRowsRest draws an error
SetRows = uBound(allSRData,2)
end if
rs.close
set rs = nothing
if not isArray(allSRData) then 'if allSRData = "" then -draws an error
SetCards = 0
SetUniqueCards = 0
else
SetCards = SetRows + 1
end if
End Sub