Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Retrieving Last Record


Message #1 by srobinson@g... on Thu, 8 Nov 2001 15:35:53
Hi All,



I have a problem retrieving the last record from an Access DB table.



I have used Recordset1.MoveLast which seems to work for every entry apart 

from one particular company. When I submit a new entry for this particular 

company, the DB always returns a record from 3 years ago as opposed to the 

one that I have just submitted.



Can anyone help?



Cheers,



Simon.
Message #2 by "Serge Wagemakers" <swagemakers@d...> on Thu, 8 Nov 2001 17:16:18 +0100
Hi Simon,



is there way to sort the resultset in such a way that the last

entry is always the last record within the recordset in your case?



What I mean is, if you have inserted a new record with a timestamp

(meaning a datetime) as a column, then to order by ascending on that

timestamp, so your sql statement would look something like:



rsSQL = "SELECT company FROM companies ORDER BY insert_date ASC"



then  MoveLast will be the last inserted record...



Correct me if I'm wrong....



Hope this helps,



Regards

Serge



----- Original Message -----

From: <srobinson@g...>

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, November 08, 2001 3:35 PM

Subject: [asp_databases] Retrieving Last Record





> Hi All,

>

> I have a problem retrieving the last record from an Access DB table.

>

> I have used Recordset1.MoveLast which seems to work for every entry apart

> from one particular company. When I submit a new entry for this particular

> company, the DB always returns a record from 3 years ago as opposed to the

> one that I have just submitted.

>

> Can anyone help?

>

> Cheers,

>

> Simon.

>




$subst('Email.Unsub')

>




  Return to Index