I have done this 3 ways.
- manually adding items to a dictionary object (works)
- adding items to a dictionary object from an array (works)
- a recordset adding items to a dictionary object (fails)
What happens is that it adds the first item but once it does that it always seems to think that the other items already exist and it never adds them. So only the first item gets added.
Essentially the line below is false the first time but somehow true for all other values
l_oRs is my recordset, I'm stumped any ideas?
- manually adding items to a dictionary object (works)
- adding items to a dictionary object from an array (works)
- a recordset adding items to a dictionary object (fails)
What happens is that it adds the first item but once it does that it always seems to think that the other items already exist and it never adds them. So only the first item gets added.
Essentially the line below is false the first time but somehow true for all other values
Code:
If(oDict.Exists(l_oRs("foo")) = true)Then
l_oRs is my recordset, I'm stumped any ideas?
Code:
l_sSQL = "select 'a' as 'foo', 'b' as 'bar'" & _
" union" &_
" select 'c' as 'foo', 'd' as 'bar'"
if (not(l_oRs.EOF and l_oRs.BOF)) Then
do until l_oRs.EOF
response.write "Does <b>" & l_oRs("foo") & "</b> exist?"
If(oDict.Exists(l_oRs("foo")) = true)Then
response.write "yes, not adding<br/>"
Else
response.write "no, adding<br/>"
oDict.Add l_oRs("foo"), l_oRs("bar")
End if
l_oRs.MoveNext
loop
else
response.write "No processing done"
end if