Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Problem with MovePrevious() in ASP

I am trying to get MovePrevious() to work in an ASP page...  here is the code that I am using...

sqltxt = "select * from customer"
Set Con = Server.CreateObject("ADODB.Connection")
Con.Open "DSN=Pets;UID=;PWD=;DATABASE=Pets"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = adOpenStatic
rs.open sqltxt, con

... then when I try to go to use MovePrevious(), the page stopps running and says that an "Exception occurred" on the line with the MovePrevious() command (rs.MovePrevious()) to be exact.

Any thoughts?

1 Solution
1 - try checking for BOF before executing the Move Previous:

If objRecordset.BOF = True
End If

2 - rs.CursorType = adOpenStatic was used - I assume you have included the adovbs.inc file, if not use the parameter value instead:

objRecordset.Open strSQL, strConnection, 3
..also try this before the execute if thomas suggestions did not fix.

rs.CusrorLocation = adUseClient,

I have had weird problems before with Static Server side cursors.(default)

You asked to split points between e-Diddy and thomasdodds.
I have reduced the points on this question from 100 to 50 as indicated by your request at Community Support. Please copy the URL and create a new question in this topic area for the other Experts to whom you wish to award points. The title of the question should read "Points for", followed by the Expert's name. In the question itself, you should paste the link to the original question and perhaps a comment stating that the points are for their help with that question. Once you have created the new questions, you can go back to the original, and accept the comment from the Expert for whom you did not create a new question. The Experts will  comment in your new "Points for" question(s), which you then accept and grade to close.
If you have any questions, please don't hesitate to ask.
Thank you.

** Mindphaser - Community Support Moderator **
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

maysbAuthor Commented:
Thanks guys.  Unfortunatly, it was my inability to code that was the problem... not any of this stuff.  Since you were both kind enough to look into this, I will split the points.  ThomasDodds, I am going to give you 50 points for answering and e-Diddy, follow this link


and submit an answer for your 50 points.

Thanks again.
maysbAuthor Commented:
Thanks again!
no problem - sometimes I need the extra eyes too!

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now