Problem with MovePrevious() in ASP

Posted on 2003-02-24
Medium Priority
Last Modified: 2012-06-22
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?

Question by:maysb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

thomasdodds earned 150 total points
ID: 8009094
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

Expert Comment

ID: 8009349
..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)

Expert Comment

ID: 8012803

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 **
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8016540
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.

Author Comment

ID: 8016545
Thanks again!

Expert Comment

ID: 8016568
no problem - sometimes I need the extra eyes too!

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question