Monday, December 17, 2007

What can I do if this error Fetching-Backward occurred?

What can I do if this error Fetching-Backward occurred?

Error found in this ASP scripts:

<%

Const adOpenForwardOnly = 0

Set conn = Server.CreateObject("Adodb.Connection")

conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb")

Set rs = Server.CreateObject("Adodb.Recordset")

rs.Open "Member",conn,adOpenForwardOnly

if Not rs.EOF then

rs.movelast ‘The error will occur here

End if

rs.Close

Set rs = Nothing

%>

The problem of this script was that: we set the CursorType to adOpenForwardOnly. We can use the MoveFirst and MoveNext in any kind of CursorType.


However, the MovePrevious and MoveLast cannot be used when the CursorType is adOpenForwardOnly.

No comments: