Hi everyone,
How can I use/display a record value (from ADO, ASP) when
it is returned as type adVariant?
I have the article from MSDN
(http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/netdir/adsi/searching_with_activex_data_objects_ado.asp)
where it shows how to loop through the record set,
determine the item's type, then write each "part" of the
recordset item using another loop.
I cannot get the innermost loop to work correctly. Here
is my code, error line marked:
While Not rsADProfile.EOF
For i = 0 To rsADProfile.Fields.Count - 1
'Check for multi-value attribute
If rsADProfile.Fields(i).Type = 12 And Not
IsNull(rsADProfile.Fields(i).Value)) Then '12 means
advariant
'Return multi-value attribute
response.write rsADProfile.Fields
(i).Name & " = "
For j = LBound(rsADProfile.Fields
(i).Value) To UBound(rsADProfile.Fields(i).Value)
response.write rsADProfile.Fields
(i).Value(j) & "," ' <-- Error here
Next
response.Write "<br>"
Else
If IsNull(rsADProfile.Fields(i).Value)
then
'Return Null Value attribute
response.write rsADProfile.Fields
(i).Name & " = (empty)<br>"
Else
'Return Single Value attribute
response.write rsADProfile.Fields
(i).Name & " = " & rsADProfile.Fields(i).Value & "<br>"
End If
End If
Next
rsADProfile.MoveNext
Wend
Which returns the error:
Wrong number of arguments or invalid property
assignment: 'Value'
It only error is I return a item that is adVariant and has
data in it. The IF statement works for empty values and
single-type values (like strings).
Any ideas?
Thanks in advance,
-chris