I think what you are trying to do is see if a value coming from your database can be found within an array.
So if you had a field in the database called Name, we'll say it has a value of "Mark" - (don't know why that name popped into my head :P)
You want to check an array of values to see if "Mark" can be found within that array, is that accurate?
If so, I wrote a function for this task. The only problem with it is that it does not account for multi-dimensional arrays, but i don't suppose you'll need that in this case anyway...
-
<%
-
Function IsLegitimate(aTemp,sTerm)
-
For i = 0 To UBound(aTemp)
-
If InStr(aTemp(i), sTerm) > 0 Then
-
IsLegitimate = True
-
Exit For
-
Else
-
IsLegitimate = False
-
End If
-
Next
-
End Function
-
-
aMyArray = Split("Mark Joe John Sam Charlie Patrick Dick Don Dawn")
-
-
If IsLegitimate(aMyArray,rs("DataField")) Then
-
Response.Write "Dude... I totally just found the name in the array."
-
Else
-
Response.Write "Aw shucks, name's not found in the array. What ever shall we do?"
-
End If
-
-
%>
-
Pretty self explanitory, will loop through an array attempting to find whatever value rs("DataField") contains, and return a boolean value of true or false depending on whether the value of rs("DataField") is found within the array or not.
HTH!
Sincerely,
Mark