473,327 Members | 2,012 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,327 software developers and data experts.

Recordset MoveLast

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
Aug 14 '05 #1
3 4739
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" <x3*@netvigator.com> ¼¶¼g©ó¶l¥ó·s»D:%2****************@TK2MSFTNGP14.phx .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

Aug 14 '05 #2
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"
Aug 14 '05 #3
> 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
Aug 15 '05 #4

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

Similar topics

4
by: Gerry Abbott | last post by:
Hi all. I wish to call a recordset from a function. Ive tried the following approach, -------------------------------------------------------- Function PassRS() As Recordset Dim db As...
2
by: | last post by:
sometimes when I call getrows from a dao recordset, I get only one row of data, instead of all rows. This happens even though I haven't called movefirst or movelast. how do I prevent this from...
12
by: Mike MacSween | last post by:
rst.eof = true and rst.bof = true or rst.movelast rst.recordcount = 0 ?
3
by: MLH | last post by:
In the code snippet below, MyMovies is a table of movie names. First field is a unique long integer ID. Second field is text string containing movie name. The second field's Indexed Property...
2
by: Sunil Korah | last post by:
I am having some trouble with opening recordsets. I have used code more or less straight from the access help. But still I am getting some errors. I am unable to work out what exactly I am doing...
1
by: Ray Holtz | last post by:
I have a database in Access 2003 (Access2000 file format). There are two tables that are being used: Employees and Items. It is linked by the Employee field so that one employee can have many...
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,...
0
ADezii
by: ADezii | last post by:
When you create a Recordset, you may want to know immediately whether that Recordset actually contains any Rows. There are Recordsets that don't return any Rows and you may need to take different...
3
by: iheartvba | last post by:
Hi Guys, thanks for the great work you are doing I am working on a database in MS Access and am trying to bring up the last receipt number in the recordset (its the primary key of the recordset)...
4
by: MLH | last post by:
160 Dim DB As Database, Rst As Recordset, QD As QueryDef 170 Set DB = CurrentDb() 180 Set QD = DB.CreateQueryDef("", MySQL) 190 Set Rst = QD.OpenRecordset(dbOpenDynaset) HOW TO COUNT RECORDS IN...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.