KathrynGZ
asked on
"Rowset does not support fetching backward"
I'm using the following code in my ASP page:
Dim myConnString
Dim myConnection
Dim mySQL
myConnString = Application("PIA27_Connect ionString" )
Set myConnection = Server.CreateObject("ADODB .Connectio n")
myConnection.Open myConnString
...
dim mySQL2
mySQL2 = "SELECT * FROM PIATable"
Set rs = myConnection.Execute(mySQL )
rs.movelast
do until rs.bof
response.write("blah blah")
rs.moveprevious
loop
*****
But when I view it in the browser, I get "Rowset does not support fetching backwards." It works fine if I change the code to move forward through the record set.
What do I need to change or add to get this code to work?
Thanks in advance--
Kathryn
Dim myConnString
Dim myConnection
Dim mySQL
myConnString = Application("PIA27_Connect
Set myConnection = Server.CreateObject("ADODB
myConnection.Open myConnString
...
dim mySQL2
mySQL2 = "SELECT * FROM PIATable"
Set rs = myConnection.Execute(mySQL
rs.movelast
do until rs.bof
response.write("blah blah")
rs.moveprevious
loop
*****
But when I view it in the browser, I get "Rowset does not support fetching backwards." It works fine if I change the code to move forward through the record set.
What do I need to change or add to get this code to work?
Thanks in advance--
Kathryn
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
KathrynGZ,
Do you need any more help??
Jus wondering whether your prob is solved or not
-Vijay
Do you need any more help??
Jus wondering whether your prob is solved or not
-Vijay
ASKER
Hi Vijay,
Just got back to work after the vacation and got your solution. This is how I implemented it (hope I understood you correctly as far as the 1,2--I'm in the process of learning VBScript):
dim mySQL2
mySQL2 = "SELECT * FROM PIATable"
'Set rs = myConnection.Execute(mySQL )
rs.Open mySQL,myConnection,adOpenK eyset,adLo ckPessimis tic
rs.movelast
do until rs.bof
response.write("blah blah")
rs.moveprevious
loop
But I got this error:
ADODB.Recordset error '800a0e79'
Operation is not allowed when the object is open.
Any suggestions? Thanks--
Kathryn
Just got back to work after the vacation and got your solution. This is how I implemented it (hope I understood you correctly as far as the 1,2--I'm in the process of learning VBScript):
dim mySQL2
mySQL2 = "SELECT * FROM PIATable"
'Set rs = myConnection.Execute(mySQL
rs.Open mySQL,myConnection,adOpenK
rs.movelast
do until rs.bof
response.write("blah blah")
rs.moveprevious
loop
But I got this error:
ADODB.Recordset error '800a0e79'
Operation is not allowed when the object is open.
Any suggestions? Thanks--
Kathryn
ASKER
Just figured it out--a previous rs wasn't closed. So Vijay, your answer worked. Thanks much!
Kathryn
Kathryn
Sorry I couldn't help you out.I was at home yesterday.
Great to know you have got that to work.
-Vijay
Great to know you have got that to work.
-Vijay
I'm a bit rusty, but something like this should do the trick;
Set myConnection = Server.CreateObject("ADODB
' declare cursor type here before opening
myConnection.CursorType = adOpenStatic
...rest of code