-
Hi I have a list and I'm trying to find out if it's members exist in two rows of an MS Access table using vb script. How do I do this? Here's my suedo code that doesn't work:
For i = 1 to MySQLQuery.eof
For Each itemInMyCommaDelimitedList
if MySQLQuery(4) = itemInMyCommaDelimitedList then
do stuff
else
itemInMyCommaDelimitedList & " is not in DB"
end if
if MySQLQuery(6) = itemInMyCommaDelimitedList then
do stuff
else
itemInMyCommaDelimitedList & " is not in DB"
end if
Next
Next
Thank you
JoeyO
-
Code:
CommaDelimitedList = "ssgfg,fgsgf,shfshfj,sfhsh,ffff....."
Dim MyArray
MyArray = Split(CommaDelimitedList , ",")
For i = 0 to Ubound(MyArray)
If MyArray(i) = MySQLQuery(4) Then
'Member exists so do the thing....
Else
Response.Write(MyArray(i) & " is not in DB <BR>")
End If
Next
For i = 0 to Ubound(MyArray)
If MyArray(i) = MySQLQuery(6) Then
'Member exists so do the thing....
Else
Response.Write(MyArray(i) & " is not in DB <BR>")
End If
Next