473,426 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

RcrdSet.MoveLast

le0
Hello guys,

I have this little problem in query, i queried one table and sort this
record in descending order but when I declared the recordset to move in the
last record but the browser rerurns an error called "Rowset does not support
fetching backward", but when I set the record to move in the first record
the browser returns the value I want. What does the error means?

code:

rstTSAnalysis.MoveLast
intItem = int(rstTSAnalysis.Fields("ItemNo").Value)

Response.Write intItem

Leo :)
Aug 24 '06 #1
2 1575

le0 wrote:
I have this little problem in query, i queried one table and sort this
record in descending order
Can you not change the underlying SQL query instead? Your database is
probably more efficient at sorting a recordset than ASP.

Aug 24 '06 #2
le0 wrote:
Hello guys,

I have this little problem in query, i queried one table and sort this
record in descending order but when I declared the recordset to move
in the last record but the browser rerurns an error called "Rowset
does not support fetching backward", but when I set the record to
move in the first record the browser returns the value I want. What
does the error means?
code:

rstTSAnalysis.MoveLast
intItem = int(rstTSAnalysis.Fields("ItemNo").Value)

Response.Write intItem
The problem is likely to be caused by the code you did not show us: cursor
type has a great deal to do with whether or not commands like MoveLast,
FoveFirst, etc. can work. The technique used to open your recordset has a
great deal to do with the cursor type used. The default cursor type is
forward-only: if you open a server-side (default - this cursor location is
specified by the constant adUseServer) recordset without specifying a cursor
type, you will get a forward-only cursor. If you specify adUseClient
(client-side cursor) for the recordset's CursorLocation property, you will
always get a static cursor (adOpenStatic), regardless of which type you may
have specified for the CursorType. Unless you specify these properties at
the Connection level (the Connection object has these properties as well as
the recordset), using Execute to open a recordset will result in the default
server-side, forward-only cursor.

Depending on the Provider being used, support for these navigational
commands can vary. Some providers will not suppport any navigation beyond
MoveNext if a default forward-only cursor is used. If you really require the
extra navigational commands (and I am not convinced that you do - it seems
to me a GetRows array would server your purposes handily), then you need
most likely need to use a more expensive static cursor (at the least). You
can guarantee that you get a static cursor by instantiating a recordset
object, setting its CursorLocation to adUseClient (3), and using its Open
method to open it, rather than using Execute.

The ADO documentation (as well as documentation for all MS development
technologies) can be found here:
http://msdn.microsoft.com/library/en...ireference.asp
I suggest you go there and _study_ the topics I discussed.

Help with GetRows can be found here:
http://www.aspfaq.com/search.asp?q=G...Days=0&order=1

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: joeandtel | last post by:
Whenever I use the function moveLast() I get an error that states, "Rowset does not support fetching backward"
3
by: tony wong | last post by:
The asp return the number of lastrecord from MsSQL server the returned number is 229 the last record number is 238 anything goes wrong? anything can assist me to troubleshoot?
1
by: Marcin Zmyslowski | last post by:
Hello! I use data.read and data.getValue(Id_column) to get the value of specified column. Unfortunately there are some differences between VBScript and Visual Basic (MS Access) and I cannot move...
1
by: marco.loskamp | last post by:
Hallo, Kurzversion: erstellt Access eine volle Kopie der Tabelle, wenn mit Currentdb.OpenRecordset("Tabelle") eine Tabelle zum Direktzugriff geöffnet wird? Hintergrund: Tabelle 1.25GB,...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
by: rudeman76 | last post by:
Hey, I am having a problem when i try to edit or use the movelast in a recordset. What i am trying to do is that when a user starts, they enter in a password on a password form. From here (in...
4
by: rudeman76 | last post by:
Hello again, I have a table that once the user logs in, it adds the crews info (crew, date, and keeps track of numbers that the user adds during the day). It also has an autonumber. The problem...
0
by: edcha | last post by:
I have the Next XML var xml = new XElement( "clients", new XElement("client", new XAttribute("id",1), new XElement( "name", "Luis"), new XElement( "country", "Portugal") ), new...
2
by: edcha | last post by:
I have the Next XML var xml = new XElement( "clients", new XElement("client", new XAttribute("id",1), new XElement( "name", "Luis"), new XElement( "country", "Portugal") ), new...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.