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

x
  • 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?

Thanks!
0
maysb
Asked:
maysb
1 Solution
 
thomasdoddsCommented:
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
0
 
e-DiddyCommented:
..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)
0
 
MindphaserCommented:
maysb

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 **
0
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

http://www.experts-exchange.com/Web/Q_20528711.html

and submit an answer for your 50 points.

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

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