Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Recordset MoveLast

Reply
Thread Tools

Recordset MoveLast

 
 
tony wong
Guest
Posts: n/a
 
      08-14-2005
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


 
Reply With Quote
 
 
 
 
tony wong
Guest
Posts: n/a
 
      08-14-2005
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.




"tony wong" <(E-Mail Removed)> glsD:%(E-Mail Removed) .gbl...
> 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
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-14-2005
tony wong wrote:
> 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

--
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"


 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      08-15-2005
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RcrdSet.MoveLast le0 ASP General 2 08-24-2006 11:22 AM
MoveFirst, MoveLast Marcin Zmyslowski ASP .Net 1 08-18-2005 09:33 PM
Can't use moveLast() function joeandtel ASP General 1 02-20-2004 08:45 PM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM
win32 adodb/mdb; con.execute returns undef and not recordset. Vikas Yadav Perl 0 09-09-2003 09:10 AM



Advertisments