Results 1 to 2 of 2

Thread: For Each itemInMyCommaDelimitedList

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    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

  2. #2
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224
    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
    If you can't pronounce my name, call me GURU

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width