This is the complete error message:
ADODB.Field error '80020009'
Object is no longer valid.
?
To see this in action w/debug, go to
www.shreveportvotes.org/report/report.asp, enter 1/1/03 for start date and 1/5/03 for end date.
Here is the loop that it occurs in:
Code:
Do While Not rs.EOF
strSales = "Sales" & rs("ID")
strShipping = "Shipping" & rs("ID")
strQty = "Qty" & rs("ID")
If Count.Exists(strSales) = True Then
Response.Write "<tr>"
Response.Write "<td>" & rs("Title") & "</td>" & vbcrlf
Response.Write "<td>"
'Response.Write Count.Item(strQty)
Response.Write "</td>" & vbcrlf & "<td>"
Response.Write FormatCurrency(Count.Item(strSales))
Response.Write "</td>" & vbcrlf & "<td>"
Response.Write "rs(""ID""): <b>" & rs("ID") & "</b><br>" & vbcrlf
Response.Write "strShipping: <b>" & strShipping & "</b><br>" & vbcrlf
Response.Write "Count.Exists(strShipping): <b>" & Count.Exists(strShipping) & "</b><br>" & vbcrlf
Response.Write "not using adodb now!, next line is '<b>Response.Write Count.Item(strShipping)</b>'." & vbcrlf
Response.Write Count.Item(strShipping)
Response.Write "</td>" & vbcrlf
strSalesTotal = strSalesTotal + Count.Item(strSales)
strShippingTotal = strShippingTotal + Count.Item(strShipping)
'strQtyTotal = strQtyTotal + Count.Item(strQty)
End If
rs.MoveNext
Loop
'Count' is a dictionary object that is populated earlier in the code, using the same keys you see in the above code:
Code:
strSales = "Sales" & rs("ID")
strShipping = "Shipping" & rs("ID")
strQty = "Qty" & rs("ID")
Note that the code for displaying the quantities are commented out solely because they cause the same problems as the shipping totals do.
While the error message doesn't specify a line, I'm fairly sure that it is this one here:
Code:
Response.Write Count.Item(strShipping)
because commenting out that line, as well as this one:
Code:
strShippingTotal = strShippingTotal + Count.Item(strShipping)
allows the page to load completely.
I don't understand why this is an ADODB.fields error, as the this isn't referencing an ADODB object, just the dictionary object. Are they somehow related? Also, both the ADODB object and the dictionary object are successfully referenced earlier in the loop. I am completely stumped on this one. Any help would be much appreciated. Thanks!
Dan