If Then Loop - help with my poor scripting

If Then Loop - help with my poor scripting

am 30.07.2005 22:36:51 von iam247

Hi
I am a relative beginner with VBscript & If, Then Loops. I have an
ASP page which attempts to compare 2 record sets and print records
which do not match.

The code below has an extra response write added at the end to confirm
the data held in the rsGroupAll recored set. With my If, Else, End If,
disabled the page works fine.

When If, Else, End If, are enabled I get a long delay then I get a time
out error message

I previously had the Response.Write (rsGroupsJ("GroupID")) in a table
and got the error

"Response object, ASP 0104 (0x80070057)"

Obviously I have put something in the wrong place.

Any help would be appreciated.


Colink
===========

'Loop through the GroupsAllrecordset THIS DOUBLE LOOP SHOULD PRINT THE
NON DUPLICATE RECORDS
Do While not rsGroupsAll.EOF
'Write the HTML to display the contents of the recordset

'Loop through the GroupsJ recordset
Do While not rsGroupsJ.EOF
If (rsGroupsAll("GroupID"))<> (rsGroupsJ("GroupID")) Then

'Write the records which do not match
Response.Write (rsGroupsJ("GroupID"))

Else

'Move to the next record in the recordset
rsGroupsJ.MoveNext


End If

Loop
'Test write to verify data in record set rsGroupAll
Response.Write (rsGroupsAll("GroupID"))
'Move to the next record in the recordset

rsGroupsAll.MoveNext
Loop