Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Sanjay #1
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
-
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... -
[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 : ... -
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' =>... -
#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: ... -
#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: ... -
stevenlmas #2
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
-
Sanjay #3
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...dim> Load rsRec1 and rsRec2 into Arrays and create a 3rd array 'arrayRec1Only'.= 1> arrayRecOnly(1) for i = 1 to ubound(rsRec1) 'get the items in array 1
> testItem = rsRec1(i) 'assign it to a var name for jtestItem => to ubound(rsRec2) 'go through array 2 and look for match iffoundMatch => rsRec2(j) then 'if there's a match, set a flag to truematch> true end if next if foundMatch = false then 'if there's noarrayRec1Only(uboundRec1Only> add 1 to the holder array index reDim preserveholder> + 1) arrayRec1Only(uboundRec1Only) = testItem 'assign value tonext> array end if foundMatch = true 'set this to false again so it finds> match, next
>
Sanjay Guest



Reply With Quote

