Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when Calling MovePrevious 1

Status
Not open for further replies.

Scanlan

Technical User
Sep 7, 2001
35
0
0
US
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(&quot;contactname&quot;)

If (Contact.EOF = False) Then
Contact.MoveNext
nextContact=Contact(&quot;contactname&quot;)
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


 
Check out this thread, it explains exactly what you're trying to do:
thread333-30027
 
Thank you so much. That's definitely gotten me in the right direction. Now it looks like I just have some logic issues to work out.

Thanks,
Ann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top