ASP/VBS Recordset to array

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default ASP/VBS Recordset to array

    Hi,

    I have 2 recordsets that return 2 lists (from 2 different Access DB):

    rsRec1

    aaa001
    aaa002
    aaa003 etc

    rsRec2

    aaa001
    aaa003 etc


    Is it possible to only list items in rsRec1 that do not appear in rsRec2?


    Regards,

    Sanjay


    Sanjay Guest

  2. Similar Questions and Discussions

    1. RecordSet.Move or RecordSet.AbsolutePosition??
      Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to...
    2. [newbie]saving and reading array of associative array
      i'm looking for examples of saving to file and reading back an array of associative array, in a ruby like way. saying i have something like : ...
    3. array data matches but array created in loop doesn't work
      I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>...
    4. #24897 [Com]: array_multisort() will reindex the array but not if array length is 1
      ID: 24897 Comment by: franklin_se at hotmail dot com Reported By: chro at sokrates dot uio dot no Status: ...
    5. #24897 [Opn->Asn]: array_multisort() will reindex the array but not if array length is 1
      ID: 24897 Updated by: sniper@php.net Reported By: chro at sokrates dot uio dot no -Status: Open +Status: ...
  3. #2

    Default Re: ASP/VBS Recordset to array

    Load rsRec1 and rsRec2 into Arrays and create a 3rd array 'arrayRec1Only'. dim
    arrayRecOnly(1) for i = 1 to ubound(rsRec1) 'get the items in array 1
    testItem = rsRec1(i) 'assign it to a var name for j = 1
    to ubound(rsRec2) 'go through array 2 and look for match if testItem =
    rsRec2(j) then 'if there's a match, set a flag to true foundMatch =
    true end if next if foundMatch = false then 'if there's no match
    add 1 to the holder array index reDim preserve arrayRec1Only(uboundRec1Only
    + 1) arrayRec1Only(uboundRec1Only) = testItem 'assign value to holder
    array end if foundMatch = true 'set this to false again so it finds next
    match, next

    stevenlmas Guest

  4. #3

    Default Re: ASP/VBS Recordset to array

    Thanks Steven,

    Wow you sure know your ASP, I'm getting an error 'type mismatch'

    I'm not sure if I have correctly split the lines from your message:

    <% 'Load rsRec1 and rsRec2 into Arrays and create a 3rd array
    'arrayRec1Only'.
    dim arrayRecOnly(1)
    for i = 1 to ubound(rsHMCEQuotes) 'get the items in array 1
    testItem = rsHMCEQuotes(i) 'assign it to a var name
    for j = 1 to ubound(rsESent) 'go through array 2 and look for match
    if testItem = rsESent(j) then 'if there's a match, set a flag to true
    foundMatch = true
    end if
    next
    if foundMatch = false then 'if there's no match add 1 to the holder
    array index
    reDim preserve arrayRec1Only (ubound Rec1Only + 1)
    arrayRec1Only (ubound Rec1Only) = testItem 'assign value to holder array
    end if
    foundMatch = true 'set this to false again so it finds next match,
    next
    %>

    BTW I have changed the rs names slightly,

    Regards,

    Sanjay



    "stevenlmas" <webforumsuser@macromedia.com> wrote in message
    news:d0ii9n$is2$1@forums.macromedia.com...
    > Load rsRec1 and rsRec2 into Arrays and create a 3rd array 'arrayRec1Only'.
    dim
    > arrayRecOnly(1) for i = 1 to ubound(rsRec1) 'get the items in array 1
    > testItem = rsRec1(i) 'assign it to a var name for j
    = 1
    > to ubound(rsRec2) 'go through array 2 and look for match if
    testItem =
    > rsRec2(j) then 'if there's a match, set a flag to true
    foundMatch =
    > true end if next if foundMatch = false then 'if there's no
    match
    > add 1 to the holder array index reDim preserve
    arrayRec1Only(uboundRec1Only
    > + 1) arrayRec1Only(uboundRec1Only) = testItem 'assign value to
    holder
    > array end if foundMatch = true 'set this to false again so it finds
    next
    > match, next
    >

    Sanjay Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139