Hello all,
I am getting the following error when calling MovePrevious:
ADODB.Recordset (0x800A0C93)
Operation is not allowed in this context.
What I'm trying to do is fill in some variables:
CurrentContact
LastContact
NextContact
I have a Recordset called Contact that I am trying to move around in to fill these variables.
CurrentContact is a field from the Contact recordset.
LastContact is empty the first time around and is set at the end of the loop.
NextContact is the tricky one. What I am trying to do is call a Contact.MoveNext to fill in the NextContact and then do a MovePrevious so that the loop control can continue as normal.
In condensed form, it looks like this:
<%
do until Contact.EOF
%>
<%currentContact=Contact("contactname"
If (Contact.EOF = False) Then
Contact.MoveNext
nextContact=Contact("contactname"
End If
If (Contact.BOF = False) Then
Contact.MovePrevious
End If
If currentContact= lastContact Then
'Do something
%>
<%else%>
'Do Something different
<%end if%>
<P>
<%
lastContact=currentContact
Contact.MoveNext
loop %>
What am I doing wrong? Any help/pointers will be greatly appreciate.
Thanks,
Ann
I am getting the following error when calling MovePrevious:
ADODB.Recordset (0x800A0C93)
Operation is not allowed in this context.
What I'm trying to do is fill in some variables:
CurrentContact
LastContact
NextContact
I have a Recordset called Contact that I am trying to move around in to fill these variables.
CurrentContact is a field from the Contact recordset.
LastContact is empty the first time around and is set at the end of the loop.
NextContact is the tricky one. What I am trying to do is call a Contact.MoveNext to fill in the NextContact and then do a MovePrevious so that the loop control can continue as normal.
In condensed form, it looks like this:
<%
do until Contact.EOF
%>
<%currentContact=Contact("contactname"
If (Contact.EOF = False) Then
Contact.MoveNext
nextContact=Contact("contactname"
End If
If (Contact.BOF = False) Then
Contact.MovePrevious
End If
If currentContact= lastContact Then
'Do something
%>
<%else%>
'Do Something different
<%end if%>
<P>
<%
lastContact=currentContact
Contact.MoveNext
loop %>
What am I doing wrong? Any help/pointers will be greatly appreciate.
Thanks,
Ann