Recordset MoveLast

T

tony wong

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?

Thanks a lot.

Tony
 
T

tony wong

i tried to move to the last record and move up (moveprevious) one by one.

the number is 219,238,212,211,207,204,199,198,193,191,189,155

how come they are not one by one.

the number is generated by auto increment of SQL server in 1 step.

any assistance? thanks.
 
B

Bob Barrows [MVP]

tony said:
i tried to move to the last record and move up (moveprevious) one by
one.
the number is 219,238,212,211,207,204,199,198,193,191,189,155

how come they are not one by one.

the number is generated by auto increment of SQL server in 1 step.

any assistance? thanks.

You failed to use an ORDER BY clause in the query used to retrieve your
recordset. The only way to guarantee the order of te records retrieved from
a relational database is to use an ORDER BY clause.

Bob Barrows
 
A

Aaron Bertrand [SQL Server MVP]

The asp return the number of lastrecord from MsSQL server

How are you defining "lastrecord"? There is no such thing as a "last row"
unless you tell the database how you are defining "last"...

If you want the biggest or most recent then you need to say something like:

SELECT TOP 1 * FROM table ORDER BY something DESC

If you would like a more specific answer, please see
http://www.aspfaq.com/5006
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top